Is my ASP.NET MVC application structured properly?

后端 未结 2 983
遥遥无期
遥遥无期 2021-02-03 15:20

I\'ve been going through the tutorials (specifically ones using Linq-To-Entities) and I understand the basic concepts, however some things are giving me issues.

The tuto

2条回答
  •  心在旅途
    2021-02-03 15:45

    I would say using DTOs and wrapping the Entity Framework with your own data access methods and business layer is a great way to go. You may end up writing a lot of code, but it's a better architecture than pretending the Entity Framework generated code is your business layer.

    These issues aren't really necessarily tied to ASP.NET MVC in any way. ASP.NET MVC gives basically no guidance on how to do your model / data access and most of the samples and tutorials for ASP.NET MVC are not production worthy model implementations, but really just minimal samples.

    It seems like you are on the right track, keep going.

    In the end, you are using Entity Framework mostly as a code generator that isn't generating very useful code and so you may want to look into other code generators or tools or frameworks that more closely match your requirements.

提交回复
热议问题