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

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

jQuery Ajax Render Fragments OR Whole Page -

java - Why is BlockingQueue.take() not releasing the thread? -