I would like to know your best experiences with F# and ORM tool. Is F# + LINQ 2 SQL having some intricacies?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the current version, the F# support for LINQ is not as smooth as in C#, but it can be used pretty well. I used F# + LINQ to SQL when implementing F# Snippets Web and was able to write almost everything using F#. There are even some nice features that you don’t get in C#.
The syntax for basic queries is based on quoted sequence expressions:
A nice thing in F# is that you can use quotation splicing to refactor your code:
Regarding the limitations of F# support:
I don’t think there are any issues with updates (as implied in the linked question).
Perhaps the largest limitation of the current version is that it has only limited support for nesting of queries (e.g. using
Seq.filterinside body offorloop), but that should be fixed in next version of PowerPack (in fact, if you compile it from source, you may get it already)If you can choose, I’d recommend using LINQ to SQL instead of LINQ to Entities. LINQ to Entities doesn’t work very well with immutable types, so you cannot easily return F# records and F# tuples. Again, this will likely improve in the future (I did some work on this recently and you can find an initial support in F# PowerPack sources)