F # - Which ORM to choose?

I just started playing with F # and wondered if there is a recommended ORM there for F #.

In C #, I used NHibernate, which seems pretty complicated and ugly to implement in F #. I also thought about using the plain old System.Data.SqlClient , but this is like going back to the Stone Age ...

Any suggestions?

+10
orm f #
source share
4 answers

I am using F # support for LINQ to SQL when working on fssnip.net . This is normal when you need to load, edit, paste objects, and it is normal for writing simple queries. It has some nice aspects, for example. You can use splicing to compose parts of a request.

However, the current implementation of the F # to LINQ translator does not handle complex queries (nested function calls, extended groupings, and joins), so I wrote several stored procedures. They can be nicely called by generated LINQ objects, but you need to write some SQL.

Alternatively, if you want to use the old-fashioned SqlClient , you can do it better using a dynamic ( ? ) Operator. I wrote about this in this blog post . For simple scenarios, this can be a good method, because it is very simple.

+7
source share

This may not be the point (for example, if it is only for education or pleasure), but if you already know how to use ORM in C #, why not just do it in C # as a library, and then do the rest of the logic in F #? One of the main selling points for .NET languages ​​is interoperability.

+5
source share

I am using LINQ to SQL through F # PowerPack. I use manual matching (i.e., I create my datacontext file manually, creating POCO classes, and also writing an XML file to determine the layout of my database). It seems to work well in F # from what I have done so far.

+1
source share

There are two options for interacting with databases using F #: FSharp.Data.SqlClient and SQLProvider .

0
source share

All Articles