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.
So which .Net ORM works most well with MYSQL database? NHibernate? Subsonic? Entity Framework ? LINQ2SQL? Or others?
Edit: I use .Net 3.5
Edit 2: Open source solution preferred.
MySQL Connector/NET is compatible with multiple versions of Entity Framework Core. For specific compatibility information, see Table 7.2, “Connector/NET Versions and Entity Framework Core Support”. The following example shows the process of creating a database from existing code.
C# Entity framework is an Object Relational Mapping (ORM) framework that gives developers an automated way to store and access databases. The Entity Framework allows developers to work with data at a higher level of abstraction.
Entity Framework (EF) is an open source object–relational mapping (ORM) framework for ADO.NET.
EF Core is an object-relational mapper (O/RM) that enables . NET developers to persist objects to and from a data source. It eliminates the need for most of the data access code developers would typically need to write.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With