SlackOverflow
SlackOverflow

Reputation: 447

ASP.NET MVC w/ EF: using Unity with the Repository Pattern for IoC

I'm trying to implement some kind of IoC on an ASP.NET MVC 3 project (built with Entity Framework for data access) by using Unity. Entities are being converted to custom objects that implement a common interface. Those custom objects are used by the controller who puts them in a "view model" and forward it to the view.

I'm following some guides but I can't find out how to configure Unity so that the right object is mapped for every controller.

Can someone point me to a good guide/tutorial/how-to? Hope I have clearly explained the problem... I have never used Unity, so forgive me if that's a dumb/noobish question.

Thanks in advance,

Daniele Salatti

Upvotes: 0

Views: 1401

Answers (1)

Amir Ismail
Amir Ismail

Reputation: 3883

Check this post it explain how to implement Repository Pattern for EntityFrameWork

http://www.codeproject.com/KB/database/ImplRepositoryPatternEF.aspx

Upvotes: 1

Related Questions