Is there an ORM tied to MS SQL 2008+, generating .NET code, which takes advantage of MS SQL specific features?
I'm specifically interested in 2 features:
(1) fetching a group of records by their key, which will not be mapped to "select in" query.
-this can be achieved by using either OPENXML
in 2005+ or by using Table-Valued Parameters in 2008+
(2) inserting more than one record with a single request to the DB (this is similar to, yet not the same as Bulk-Insert). For example:
Customer[] customers = CreateSomeCostomers();
dataManager.Save(customers);
So the SQL related code is prepared on the client, and then sent entirely to the SQL server.
BTW, stored procedures are out of the question.
I'd be happy if you stackoverflowers have any advice for me.
Thanks!
Update:
I'm looking for a complete solution, not an extensible framework/product that I could customize to my needs. So customizing NHibernate/linq2sql/etc. by writing my own code implementation does not suit my needs.
A few words about the accepted answer.
It seems that currently all ORM frameworks try to cover more than a single database/technology. So I guess there's no ready solution for my needs, at least nothing out of the box.
I understand that @Ryk, pointing to Fluent NHibrenate, believes that such solution actually exists, and it's a matter of configuration. I took a look into the source code of both NHibernate and Fluent NHibernate, and I found nothing that supports the features I'm looking for. For instance, I couldn't find the keyword OPENXML
or sp_xml_preparedocument
in both source codes. So maybe I'm missing something, but I don't think so. Since the bounty is time-limited, I can't take a deeper investigation in FN or NH. I still think these features are not supported there.
So, the accepted answer is, per my best understanding, that there's no such thing. The most generic answer claiming that, is @Cade Roux's answer.
I thank you all for your participation. Cheers!
If you want to use SQL Server features, then a black box ORM isn't going to cater to that.
If you want to get the most out of your chosen database (any database), you are going to be more tightly coupled and so you are better off with code-generation for (generating both stored procs and) your mapping layer instead of a drop-in ORM.