开发者

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

开发者 https://www.devze.com 2023-04-04 16:58 出处:网络
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 comm

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 ev开发者_运维问答ery 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


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消