我用的是ADO.NET,我已经创建了DAL和BAL,结构如下
DAL
-POCO(Table to Entities mapping)
-Repository (Add, Delete, Edit, Select, Search)
BAL
-POCO(DAL to Entities mapping where Entities are complex type here)
-BusinessManager(Validation and Business rules)
我将使用服务公开 BAL。Web、Window、Mobile 等多个应用程序将使用此 BAL。
我不确定 Sql Transactions 应该从哪里开始。谁负责创建复杂的实体。
例如,复杂实体可能是
Entity
-Entity Type
-Contacts
-EmployeesReporting
-ReportingTo
现在谁应该创建一个实体?它是 BAL 还是 DAL。SqlTransactions 应该从哪里开始?我应该如何使这些实体支持延迟加载,因为我是存储过程的支持者,并且更喜欢每个请求使用一个数据库连接