是否应在表示层中添加DAL参考?如何访问表示层中的表实例? [英] Should DAL reference added in Presentation Layer? How to access the instance of table in presentation Layer?
问题描述
亲爱的所有人,
我在VS 2010中创建了3层Arch WPP.我在Presentation Layer中添加了BusinessAccessLayer引用.我创建了DataAccessLayer [DAL]和ORM [DBModel.DBML].当我尝试在演示层[default.aspx]中创建表的实例时,未显示表名称.
在表示层中添加DataAccessLayer引用后,将显示表名称[MM_User]实例.
是正确的方法[在Presenation层中添加DAL引用]吗?
如果没有,访问表实例的解决方案是什么[MM_User].
Dear All,
I creating 3 tier arch wpp in VS 2010. I added the BusinessAccessLayer refernce in Presentation Layer. and I created DataAccessLayer[DAL] and ORM [DBModel.DBML]. when i try to create the instance for the Table in presenation layer[default.aspx], The Table name is not shown.
After adding the DataAccessLayer refernce in the presentation layer, the table name[MM_User] instance are shown.
Is it the right method [Adding the DAL refernce in Presenation Layer]?
If not, whats the solution for for accessing the instance of the tables[MM_User].
Is it related to the Creating the DataContextWrapper class in DAL?
推荐答案
似乎与您在此处缺少Model-Class有关.
有:
1.模型类项目-包含所有对象类(您所谓的期望表结构)
2.数据访问层-引用模型类DLL以使用对象模型
3.业务逻辑层-引用DAL dll和Model类DLL
4.表示层-请参阅BLL和模型类DLL
这样,您的体系结构将满足需求并为您提供图层系统.
Looks like you are missing your Model-Class here.
Have:
1. Model class project - has all the object classes in it (your so called expected table structure)
2. Data Access Layer - Refer Model class DLL to use the object model
3. Business Logic Layer - Refer DAL dll & Model class DLL
4. Presentation Layer - Refer BLL & Model class DLL
This way, your architecure would be supporting the need and provide you layer system .
您好,
您能解释一下有关Model Class项目的更多信息吗?
我在DAL中添加了ORM [DBModel.DBML],对吗?
或
我应该在模型类项目中添加ORM [DBModel.DBML]吗?
您可以在这方面帮助我吗?
Hi,
Can you explain more about the Model Class project?
I added ORM [DBModel.DBML] in DAL, Is it right?
or
should I add ORM [DBModel.DBML] in Model Class project?
Can you help me in this regard?
这篇关于是否应在表示层中添加DAL参考?如何访问表示层中的表实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!