Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8501345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:11:14+00:00 2026-06-11T01:11:14+00:00

I am having trouble with the pro asp.net mvc 3 framework book. On page

  • 0

I am having trouble with the pro asp.net mvc 3 framework book. On page 175 Creating the Product Repository.

I have errors: Error 1 ‘SportsStore.Domain.Concrete.EFProductRepository’ does not implement interface member ‘SportsStore.Domain.Abstract.IProductRepository.Products.set’
SportsStore\SportsStore.Domain\Concrete\EFProductRepository.cs 11 18 SportsStore.Domain
#

Error 2 The type or namespace name ‘Concrete’ does not exist in the namespace ‘SportsStore.Domain’\SportsStore.WebUI\Infrastructure\NinjectControllerFactory.cs 11 26 SportsStore.WebUI

This is my repository:

using System; using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using SportsStore.Domain.Abstract; 
using SportsStore.Domain.Entities; 
//using System.Web;

namespace SportsStore.Domain.Concrete 
{
    public class EFProductRepository : IProductRepository
    {
        private EFDbContext context = new EFDbContext();
        public IQueryable<Product> Products
        {
            get { return context.Products; }
        }
    } 
}

My Product class which is public:

namespace SportsStore.Domain.Entities 
{
  public class Product
  {
      public int ProductID { get; set; }
      public string Name { get; set; }
      public string Description { get; set; }
      public decimal Price { get; set; }
      public string Category { get; set; }
  } 
}

my interface:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using SportsStore.Domain.Entities;

namespace SportsStore.Domain.Abstract 
{
  public interface IProductRepository
  {
      IQueryable<Product> Products { get; set; }
  } 
}

My EFDBContext class:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using SportsStore.Domain.Entities; 
using System.Data.Entity;

namespace SportsStore.Domain.Concrete 
{
  public class EFDbContext : DbContext 
  {
      //DBset<type>   Property name is Products
      public DbSet<Product> Products { get; set; }
  }
}

My ninjectcontrollerfactory class:

using System; using System.Collections.Generic; 
using System.Linq; using System.Web; 
using System.Web.Mvc; 
using System.Web.Routing; 
using Ninject; 
using Moq; 
using SportsStore.Domain.Abstract; 
using SportsStore.Domain.Entities; 
using SportsStore.Domain.Concrete;

namespace SportsStore.WebUI.Infrastructure 
{
    public class NinjectControllerFactory : DefaultControllerFactory 
    {
        private IKernel ninjectKernel;

        public NinjectControllerFactory()
        {
            ninjectKernel = new StandardKernel();
            AddBindings();
        }

        protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
        {
            return controllerType == null ? null : (IController)ninjectKernel.Get(controllerType);
        }

        private void AddBindings()
        {
            //P163 - Add a mock implementation of the IProductRepository Interface
            //Mock<IProductRepository> _mock = new Mock<IProductRepository>();
            //_mock.Setup(m => m.Products).Returns(new List<Product> 
            //{
            //    new Product {Name = "Football",Price = 25},
            //    new Product {Name = "Surf Board",Price = 179},
            //    new Product {Name = "Running Shoes",Price = 95},

            //}.AsQueryable());
            //_ninjectKernel.Bind<IProductRepository>().ToConstant(_mock.Object);


            ninjectKernel.Bind<IProductRepository>().To<EFProductRepository>();    //P176 Bind to our Live repository

        }

    } 
}

There are 3 projects with references:
SportsStore.Domain
SportsStore.UnitTests = ref to Moq, Ninject,SportsStore.Domain, SportsStore.WebUI
SportsStore.WebUI = ref to Ninject,SportsStore.Domiain

I have search google and it says add a reference on the SportsStore.Domain project to the WebUI project but when i do this it says it cant because it will cause a circular dependency.

Error 1 and Error 2 above, I don’t understand because the interface is implemented and also the namespace is in the NinjectControllerFactory where I am binding the IProductRepository to the interface EFProductRepository

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:11:15+00:00Added an answer on June 11, 2026 at 1:11 am

    Take the ‘set’ away from

    public interface IProductRepository 
    { 
        IQueryable<Product> Products { get; set; } 
    }  
    

    and it should solve your problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having Trouble with Entity Framework. I have been populating EntityReferences with an EntityKey inorder
I'm following Pro ASP.Net MVC2 book and literally 90% of everything is new to
Specs GHC 6.12.1 Mac OS X 10.6.4 x64 MacBook Pro Problem I'm having trouble
I am having trouble gaining access to FileMaker Pro 11 data through the ODBC
I have this web page I'm developing that displays multiple images of one product
Having trouble with some select statements. I have 2 tables. sms_log and sms_messages. sms_log
Having trouble to start a new activity after progressbar have loaded. Im getting stucked
Having trouble figuring this one out.. I currently have a frmMain and a frmLoading..
I am having a lot of trouble using .dbf files. I have an application
Having trouble linking the Stomp.framework into an iPhone SDK application. http://code.google.com/p/stompframework/ I follow the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.