linq to sql - DataContext, Repositories and Unit of Work -


i have 2 repositories 2 different entities , each 1 has own private linq-to-sql datacontext.

in addition, have service class must return result these 2 repositories.

question 1 - should have common datacontext both repositories? (i guess instantiating datacontext in service class , injecting 2 repositories.)

question 2 - unit of work for? many help.

this tutorial answered questions:

http://www.asp.net/entity-framework/tutorials/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -