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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:10:44+00:00 2026-05-28T18:10:44+00:00

So, I am trying to implement best practices during the design phase of a

  • 0

So, I am trying to implement best practices during the design phase of a system. I am going to be using a DI container (ninject) with Entity Framework 4, ASP.NET MVC 3 C#, and the repository / unit of work pattern.

  • I am going to have models where each database’s tables are mapped to classes.
  • I am going to have a connection string for each database in web.config.
  • I am going to have a class for each connection string (named the same using EF convention) which inherits from DbContext and has a DbSet for each table.
  • I am going to have an abstract repository interface for each database entity named by convention ITRepository where T is the name of the DataBase entity (ICarRepository for database entity Car). Each repository interface will hold an IQueryable for the entity and also define what methods should be exposed.
  • I am going to have a concrete repository EFTRepository which inherits from ITRepository and defines how the exposed methods work.
  • I am going to have a GenericRepository<TEntity> defined for use with entities that require only minimal access such as basic CRUD.
  • I am going to use a ControllerFactory from ninject as a DI container.
  • I am going to attach the ninject controller factory in Application_Start().
  • I am going to bind all my dependencies, such as Bind<ITRepository>().To<EFTRepository>() in the factory’s AddBindings() method.
  • I am going to implement a Unit Of Work pattern for each database and keep to naming conventions UnitOfWorkDB (UnitOfWorkAutomobile for database Automobile).
  • The Unit Of Work will hold the relevant database context and repositories.
  • Am I going about this right? I haven’t used this set of patterns before and want to make sure I am going to be using them correctly. Criticisms welcome!

    • 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-05-28T18:10:45+00:00Added an answer on May 28, 2026 at 6:10 pm

      Inheriting from a base repository can provide some simple ‘generic’ functions but in other situations you’ll quickly find out it becomes messy trying to have a generic based repository (assuming that was what was inheriting).

      Everything else you described seems pretty good.

      You didn’t say what was going to be injected where though, I’m assuming you will be injecting a service, the service will take a unit of work (IUnitOfWork for ex., created as a per request instance) and an IWhateverRepostory

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

    Sidebar

    Related Questions

    Trying to implement a rating system of users and postings. What is the best
    I am an MVC noob, but trying to implement best practices and keeping as
    I'm trying to use Entity Framework in an ASP.NET MVC web application. Let's say
    trying to implement a dialog-box style behaviour using a separate div section with all
    I trying to implement the active record pattern using Java/JDBC and MySQL along with
    I am trying to find some example code or best practices about making CMS-type
    I'm trying to take my code to the next level. Following some best practices
    I'm trying to implement the export functionality for my database application. I'm using C#
    I'm trying to teach myself the repository pattern, and I have a best practices
    I'm trying to implement a Remember Me login functionality for an ASP.NET MVC site

    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.