Basically I'd like to do what LINQ does and load & save my objects without queries. Any tips?
It looks like I'm trying to emulate LINQ to SQL an Object Relational Mapping.
Basically I'd like to do what LINQ does and load & save my objects without queries. Any tips?
It looks like I'm trying to emulate LINQ to SQL an Object Relational Mapping.
What you are asking for looks like an Object-relational mapper with LINQ provider.
For instance, NHibernate ORM (my personal favorite) supports both PostgreSQL and MySQL. As of version 3.0 it has a built in LINQ provider.
Microsoft's Entity Framework doesn't have out of the box support for many database engines, as NHibernate has, but there are third party solutions. Btw, EF got open-sourced two days ago.
There's an interesting site that compares various ORMs in .NET world - ORM Battle. There you can find a list of other popular ORMs and see how they compare to each other.
Some SO ORM questions:
https://stackoverflow.com/questions/132676/which-orm-for-net-would-you-recommend
Best ORM to use with C# 4.0
Also, micro-ORMs have recently risen in popularity. They don't really offer a full object to database mapping, nor Linq support (most of them) but they could be a good tool for the job.