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

  • SEARCH
  • Home
  • 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 8740195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:05:20+00:00 2026-06-13T11:05:20+00:00

I am slowly trying to improve my knowledge of Enterprise Application Development. With regard

  • 0

I am slowly trying to improve my knowledge of Enterprise Application Development. With regard to best practices I have learned about creating concrete repository implementations of iRepository interfaces and so far it makes sense.

Where I am challenged is when (as it often happens) I want to return data that is coming from two or more tables in one result set, and how to best approach this.

I understand that identifying aggregate roots is probably the best way to go but am wondering how to approach this with regard to interfaces and repositories when it comes to using specific/custom repositories vs generic repositories.

Generic Repositories seem like a great way to cut down on the need to create individual iRepositories for each required implementation, but the problem is that not all of my concrete classes have a need for all of the methods in the Generic Repository Interface, ie sometimes I will need more and other times I will need less.

I am wondering what is the best practice to approach this situation? Do developers normally have one generic repository interface and then create more specific ones for more specific Data Access needs?

I have used this project as a guideline for best practice:
http://efmvc.codeplex.com/

  • 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-13T11:05:21+00:00Added an answer on June 13, 2026 at 11:05 am

    The generic repository should only contain the minimal amount of methods. I usually then create a specific repository for each aggregate root (a new interface and a new class which inherits the generic repository).

    Something like:

    public interface IRepository<T>
    {
        void Create(T);
        void Update(T);
        T Get(int key);
    }
    
    public interface IUserRepository : IRepository<User>
    {
        User GetByUserName(string userName);
    }
    

    So the user repository looks like:

    public class UserRepository : Repository<User>, IUserRepository
    {
         public User GetByUserName(string userName)
         {
             return DbContext.Users.FirstOrDefault(x => x.UserName == userName);
         }
    }
    

    But lately I’ve moving towards queries instead, like I describe here: http://blog.gauffin.org/2012/10/griffin-decoupled-the-queries/

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

Sidebar

Related Questions

We are currently maintaining a Perl web application and we are slowly trying to
I'm trying to improve the performance on a query that is running very slowly.
We have a production machine and are trying to slowly introduce some 3.0 and
I have been trying to figure out why this PL/SQL purge script runs slowly
I'm trying to make a twitter like system that scrolls through info slowly and
So I'm still trying to get comfortable using Parsec, but I'm slowly working it
Been slowly picking up the basics in IOS Programming, but seemed to have hit
I've been learning Unity 3D, slowly. I'm trying to make a maze, and need
I'm trying to slowly knock out all of the intricacies of python. Basically, I'm
I'm trying to learn a bit about dynamic programming and had a peice of

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.