I have a bunch of POCO's that I created that I want to create a persistent layer for. Thing is, I really don't care how the data is stored in SQL Server, I just want it to be stored. In other words, I want to tell the ORM tool, "Here's some POCO classes, save them." and not have to do anything beyond that. Is there any ORM tool for C# that can do this? I've been struggling to get Fluent NHibernate working and Subsonic doesn't support relationships, which makes doing stuff like "Get all comments for a single post" pretty difficult. It needs to be able to automatically generate a database schema without me having to set a bunch of attributes and whatnot.
If you do not care how it is stored than why SQL Server? How about couchDB http://couchdb.apache.org/docs/intro.html
I personally use Fluent NHibernate and it does for me what you need. Well, almost. There're thing like need to manually specify ManyToMany but you can't avoid it. And if you want good entities design you have to make some members private, which disables automapping for these members. Still, I changed my design a LOT and never even thought about how my DB is changed (a luxury of a fresh project, but...).
Did you look at Castle ActiveRecord? Do you really need real POCOs, or you can live with attributes and .Save on entities? Well, I'd avoid that but it may work for you.
Check out Subsonics SimpleRepository. Create a class, make a database, give Subsonic a connection string and it handles the rest. Nifty.
You can try DataObjects.Net, but it is not exactly what you are looking for. First of all its entities are not poco, you must inherit them from certain base type. Second, you should mark fields you want to be saved with special attribute.
So why I recommend DataObjects then? Because I think it's fully black-boxes database. You just make a bunch of objects and ask ORM to save them.
- It automatically generates database schema in specified RDBMS in runtime.
- You don't have to call methods like .Save() to save changes, just work like with usual objects.
- You don't have to write SQL queries - it fully supports LINQ.
- You don't have to deal with SQL scripts even when existing database is being upgraded to next version.