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

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -