DbLinq

Today I had to look into persisting some of the data from the new system we are building into existing legacy system for backwards compatibility until the old system can retired (data that is required for the old applications/services that is a product of the new system). The database was MySql. The new system is leveraging FluentNHibernate to do the Domain objects persistence. The legacy system has no relational tables, and it’s just a matter of inserting information into the legacy DB. Since FluentNHibernate was not a good fit for the job, I looked into leveraging raw ADO.NET to do the simple job. And I couldn’t. Raw ADO.NET feels ugly after you get used to an ORM. So I thought about alternative, Linq to SQL. Well, Linq to MySql to be precise. I found DbLinq project which I highly recommend if you want Linq to any non MS SQL database (Oracle, MySql, SqlLite, Ingres, etc.)

I had to mess around a bit with AttributeMappings in order to inject table names dynamically, but rather than that it was quiet smooth.

This was definitely the right tool for the quick job.

No Comments