开发者

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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜