3层拱门,带有EF 4和仅限代码的方法 [英] 3 tier arch with EF 4 and code only approach

查看:90
本文介绍了3层拱门,带有EF 4和仅限代码的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,


我如何通过EF和Code only方法实现3层拱门..我的UI将访问我的BLL,这只是POCO课程。和BLL将调用DAL,这只是EF与配置。我需要在DAL中引用BLL因为我需要创建
EntityConfigurations,同时当UI创建BLL对象时,我需要从BLL调用DAL保存该对象,但这会给出我的循环引用错误。


请帮忙解决。


谢谢


hhk999

解决方案

你好,


 


在典型的体系结构中,您的UI层将创建新的BLL对象,然后调用DAL来插入实例。


 


存储库模式通常用在您描述的体系结构中,以避免将UI层绑定到一种特殊的持久性技术,虽然这不是
意味着需要。


 


〜罗文


Dear All,

How can i achieve 3 tier arch with EF and Code only approach.. I have my UI who will access my BLL which is nothing but POCO classes. and BLL will call DAL which is nothing but EF with Configurations.. I need to refer BLL in DAL becuase i need to create EntityConfigurations, at the same time when UI creates a BLL object , i need to call DAL from BLL to save that object , but this will give my cyclic reference error.

please help to resolve.

Thanks


hhk999

解决方案

Hello,

 

In a typical architecture your UI layer would create the new BLL object and then call the DAL to insert the instance.

 

The repository pattern is commonly used in the architecture you described to avoid tying the UI layer to a particular persistence technology, although this is by no means required.

 

~Rowan


这篇关于3层拱门,带有EF 4和仅限代码的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆