[英]Database and logic layer for ASP.NET MVC application
I'm going to start a new project which is going to be small initially but may grow to big over the years. 我将开始一个新项目,该项目最初规模不大,但随着时间的推移可能会扩大。 I'm strongly convinced that I'm going to use ASP.NET MVC with jQuery for UI. 我坚信我将使用ASP.NET MVC和jQuery for UI。 I want to go for MySQL as database for some reasons but worried on few things. 由于某些原因,我想将MySQL用作数据库,但担心的是几件事。
I'm totally new to Linq but it seems that it is easier to use once you are familiar with it. 我对Linq完全陌生,但是一旦您熟悉它,它似乎更易于使用。
First thing is that accessing data should be easy. 第一件事是访问数据应该很容易。 So I thought I should use MySQL to Linq but somewhere I read that it is not directly supported but MySQL .NET connector adds support for EntityFramework. 因此,我认为我应该在Linq上使用MySQL,但是我读到某个地方它没有直接支持,但MySQL .NET连接器增加了对EntityFramework的支持。 I don't know what are the pros and cons of it. 我不知道它的优点和缺点。 DbLinq is what I also heard. 我也听到了DbLinq。 I would love if I can implement repository pattern as it allows to apply filter in logic layer rather than in data access layer. 我希望能实现存储库模式,因为它允许在逻辑层而不是数据访问层中应用过滤器。 Will it be possible if I use Entity Framework? 如果使用实体框架,是否有可能?
I'm also concerned about the performance. 我也很担心表现。 Someone told me that if we use Entity framework it fetches lot of data and then filter it. 有人告诉我,如果使用实体框架,它将获取大量数据,然后进行过滤。 Is that right? 那正确吗?
So questions basically are - 所以问题基本上是-
If it sounds too many questions from my side in that case, if you can just let me know what you will do (with a considerable reason) in this situation as an experienced person in this area, that should answer my question. 如果在这种情况下在我这边听起来有太多问题,如果您可以让我知道在这种情况下作为该领域的有经验的人您将做的事情(有充分的理由),那应该回答我的问题。
因为我是ALT.NET的粉丝,所以我建议您将NHibernate用于您的项目而不是EntityFramework,您可以在Google上寻求它的优点,我相信您会选择它。
Based on the points you've mentioned, then I would seriously consider going with MS SQL instead of MySQL initially and implementing LINQ-to-SQL instead of Entity Framework, and here's why: 基于您提到的观点,然后我将认真考虑最初使用MS SQL而不是MySQL并实现LINQ-to-SQL而不是Entity Framework,这是为什么:
I don't know what your project is, but you don't want to get into a situation where you're going to have trouble scaling the application later. 我不知道您的项目是什么,但是您不希望遇到以后无法扩展应用程序的情况。 Code for the end result, not for the starting point, and you'll save yourself a lot of headaches later. 为最终结果而不是起点编写代码,以后您将省去很多麻烦。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.