Code Monkey home page Code Monkey logo

unitofworkwithmultipledbcontext's Introduction

Unit Of Work With Multiple DBContexts

A MVC 5 application with Automapper, EF 6, repository pattern, dependency injection using Autofac which uses one unit of work to deal with multiple dbcontexts with Async functions.

Features:

  • Entity Framework 6
  • MVC 5 Web App
  • Async MVC 5 Web App
  • MVC 5 WepAPI 2
  • Dependency Injection and IOC using Autofac
  • Unit Of Work with multiple DBContexts
  • Generic Repository with Async functions
  • Code First approach
  • Power of repository extensibility
  • NUnit with Async Tests
  • Moq

Instructions:

  • Please alter connection strings in the application's webconfig file.
  • Go to package manager console -> select UoW_MultipleDBContext.Data and execute the command 'update-database -verbose'.

Hope this design pattern helps. Any suggestions are welcome in improving this framework.

-- Raghav

unitofworkwithmultipledbcontext's People

Contributors

planczero avatar raghav-rosberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unitofworkwithmultipledbcontext's Issues

Seperation of EntityObjects & POCO

I am following your architecture style for my project which is great by the way. I am a beginner in this style of structure and I have been reading various articles about it. One thing I keep noticing is the main focus on separating dependencies between projects. Now in your solution, you have two projects (Entity, Data). However, the Data's DBContext is using the classes in Entity. Which makes the Entity Classes as EntityObjects. However, you then use them in service & presentation as POCO objects. This creates a dependency of the EntityObjects to the other tiers.

So in future, if Database structure is changed but not needed for the presentation or service tiers, then this will not be useful.

In my understanding, the Entity project should have POCO classes and the Data should have the EntityObject classes. And in the repository, AutoMapper is used to map and convert the EntityObject class to POCO class to return to the caller.

Please feel free to correct me if my understanding is incorrect. Would really appreciate to learn the correct way this should be if my understanding is wrong.

File name has to be changed

The file name under UnitOfWork folder DBTwoRepository where as class name DBTwoRepositories.

So I believe the file name DBTwoRepository has to be changed as DBTwoRepositories

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.