net ORM可以很好地使用MySQL。

时间:2022-02-11 06:56:59

My C# Windows Service ( It's a service, not a MVC web application!) needs to talk to MYSQL database. In order to ease my data layer effort I am thinking about using an ORM for this purpose.

我的c# Windows服务(它是一个服务,而不是MVC web应用程序!)需要与MYSQL数据库对话。为了简化我的数据层工作,我正在考虑为此目的使用ORM。

So which .Net ORM works most well with MYSQL database? NHibernate? Subsonic? Entity Framework ? LINQ2SQL? Or others?

那么,什么。net ORM最好用MYSQL数据库呢?NHibernate吗?亚音速吗?实体框架?LINQ2SQL吗?还是其他人?

Edit: I use .Net 3.5

编辑:我使用。net 3.5。

Edit 2: Open source solution preferred.

编辑2:首选开源解决方案。

5 个解决方案

#1


7  

I'm completely biased, but I'd go NHibernate. I've managed, with some tweaking, to get the same DAL code working with Access (for CD delivery), Sql Server (for corporate), and MySql (for the laugh of it). This is a few years back now, and I did have to make sure that the field/table names were valid in all environments. Other than that NHibernate did the rest - brilliant.

我完全有偏见,但我会去NHibernate。我已经进行了一些调整,以获得与访问(CD交付)、Sql Server(用于公司)和MySql(用于笑声)的相同的DAL代码。这是几年前的事情,我必须确保字段/表名在所有环境中都是有效的。除了NHibernate之外,其余的都很出色。

#2


5  

I cannot believe no one has mentioned Rob Conerys SubSonic!! This should be required studying for all ORM users. Sure NHibernate has its supporters, great tutorials and alot of good points. But Subsonic also generates the DAL for you automagically and leaves you to the business of the business layer, testing and presentation layers.

我真不敢相信竟然没有人提到过罗伯·科尼尔的亚音速!!这需要为所有ORM用户学习。当然NHibernate有它的支持者,很棒的教程和很多优点。但是Subsonic也会自动生成DAL,并将您交给业务层、测试层和表示层的业务。

#3


0  

I prefer LLBLGen.

我更喜欢LLBLGen。

#4


0  

For mysql specifics NHibernate has a small issue with zero value dates in mysql. Since I've only used it with MSSQL and postgres I can't tell if it's anything to worry about.

对于mysql细节,NHibernate在mysql中有一个小的问题,零值日期。因为我只使用了MSSQL和postgres,所以我无法判断它是否值得担心。

If you have experience with Hibernate or other ORMs from Java or other languages NHibernate or ActiveRecord (based on NHibernate) will feel very familiar.

如果您有使用Hibernate或其他Java或其他语言的ORMs的经验,NHibernate或ActiveRecord(基于NHibernate)将会感到非常熟悉。

#5


-1  

I would stay away from the entity framework or LINQ to SQL for that matter for tiered development. That being said i haven't tried either LLBLGen or NHibernate.

我将远离实体框架或LINQ to SQL,以实现分层开发。那就是说我没有尝试过LLBLGen或NHibernate。

#1


7  

I'm completely biased, but I'd go NHibernate. I've managed, with some tweaking, to get the same DAL code working with Access (for CD delivery), Sql Server (for corporate), and MySql (for the laugh of it). This is a few years back now, and I did have to make sure that the field/table names were valid in all environments. Other than that NHibernate did the rest - brilliant.

我完全有偏见,但我会去NHibernate。我已经进行了一些调整,以获得与访问(CD交付)、Sql Server(用于公司)和MySql(用于笑声)的相同的DAL代码。这是几年前的事情,我必须确保字段/表名在所有环境中都是有效的。除了NHibernate之外,其余的都很出色。

#2


5  

I cannot believe no one has mentioned Rob Conerys SubSonic!! This should be required studying for all ORM users. Sure NHibernate has its supporters, great tutorials and alot of good points. But Subsonic also generates the DAL for you automagically and leaves you to the business of the business layer, testing and presentation layers.

我真不敢相信竟然没有人提到过罗伯·科尼尔的亚音速!!这需要为所有ORM用户学习。当然NHibernate有它的支持者,很棒的教程和很多优点。但是Subsonic也会自动生成DAL,并将您交给业务层、测试层和表示层的业务。

#3


0  

I prefer LLBLGen.

我更喜欢LLBLGen。

#4


0  

For mysql specifics NHibernate has a small issue with zero value dates in mysql. Since I've only used it with MSSQL and postgres I can't tell if it's anything to worry about.

对于mysql细节,NHibernate在mysql中有一个小的问题,零值日期。因为我只使用了MSSQL和postgres,所以我无法判断它是否值得担心。

If you have experience with Hibernate or other ORMs from Java or other languages NHibernate or ActiveRecord (based on NHibernate) will feel very familiar.

如果您有使用Hibernate或其他Java或其他语言的ORMs的经验,NHibernate或ActiveRecord(基于NHibernate)将会感到非常熟悉。

#5


-1  

I would stay away from the entity framework or LINQ to SQL for that matter for tiered development. That being said i haven't tried either LLBLGen or NHibernate.

我将远离实体框架或LINQ to SQL,以实现分层开发。那就是说我没有尝试过LLBLGen或NHibernate。