领域逻辑、DAL、数据库 - 放置什么、在哪里?以及如何与他们互动?
我有以下任务:
我必须创建以下内容:域逻辑、数据访问层、数据库。
我还必须创建一个 ASP.Net 页面来处理上述部分(ASP.Net 只是系统的一部分,可能还有桌面应用程序等)。
我想使用实体框架作为数据访问层,但这是我的困惑: 我不知道应该如何创建不同的层...我无法弄清楚它们是什么项目类型...我通常会在带有 SQL 数据库的 C# Windows 窗体项目中使用 ADO.Net 实体框架。然而,事实上我将拥有可能使用域逻辑的 ASP.Net 和 Windows 窗体,这一事实让我困惑于如何以及在何处放置每个部分?域逻辑、DAL 和数据库......?另外,我如何与每一层交互?任何帮助将不胜感激,因为我目前不知道如何解决这个问题。我希望我能合理地解释这一点,谢谢。
I have the following task:
I have to create the following: Domain Logic, Data Access Layer, Database.
I will also have to create an ASP.Net Page to work with the aforementioned pieces (ASP.Net is only part of the system, there may be a desktop app etc).
I want to use the Entity Framework as the Data Access Layer, but here is my confusion:
I dont know how I should go about creating the different layers... I cant work out what project type they would be..I would usually use the ADO.Net Entity Framework within a C# Windows Form project with a SQL Database. However, the fact that I will have ASP.Net and Windows Forms possibly using the domain logic confuses me as to how and where I would place each part? The Domain logic, the DAL and the Database..? Also, how would I interact with each layer? Any help would be GREATLY appreciated as I have no clue how to go about this currently.. I hope I explained this reasonably, Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会为每个项目创建单独的项目,即:
通过该设置,您可以在 WinForm、WPF 等中重用库项目。 ..仅通过引用库来进行项目。
I would create separate projects for each, i.e:
With that setup, you can reuse your library projects in WinForm, WPF, etc... project by just referencing the libraries.