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 7751411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:32:27+00:00 2026-06-01T11:32:27+00:00

I have a repository like: public class Repository<TEntity> : IRepository<TEntity> where TEntity : class,

  • 0

I have a repository like:

public class Repository<TEntity> : IRepository<TEntity> where TEntity : class, IEntity
{
    protected readonly IContext _db;

    public Repository(IContext context)
    {
        _db = context;
    }

   ...
}

Within methods in this class I can write statements with includes like:

var regionalAdmins = _db.Users.Include("Areas");

So then I wrote a repository which inherits from that one:

public class AreaRepository : Repository<Area>
{
    public AreaRepository(IContext context) : base (context)
    {
    }

    public new IEnumerable<Area> GetAreas()
    {
        return _db.Users.Include("Areas");
    }
}

At this level though I get the error:

System.Data.Entity.IDbSet’ does not contain a definition
for ‘Include’ and no extension method ‘Include’ accepting a first
argument of type ‘System.Data.Entity.IDbSet’ could be
found

Why would this be happening? I have the same context it just coming from the parent.

  • 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-01T11:32:29+00:00Added an answer on June 1, 2026 at 11:32 am

    Include is an extension method declared in System.Data.Entity.DbExtensions. You’re probably missing a using clause for the System.Data.Entity namespace.

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

Sidebar

Related Questions

I have a repository like that: public class Repository<T> : IRepository<T> where T :
I have a generic repository as like that public class Repository<T> : IRepository<T> where
I have a NHibernate repository that looks like this: public class NHibRepository : IDisposable
Simple question: Part of my repository looks like this public class CustomerRepository : IRepository<Customer>
Hello. I have a list that looks like this one: public class PagedList<T> :
I have something like this: public void Delete(T entity) { Context.DeleteObject(entity); Context.SaveChanges(); } I
I have the following domain object: public class Bank : IEntity { } And
I have a repository pattern setup using NHibernate. The base class looks like this:
I have a repository class that defines some basic Get/Save/Delete methods. Inside these, I
I have a domain model that includes something like this: public class Customer :

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.