Search code examples
ormf#type-providers

Will F# type providers provide a good base for implementing an object-relational mapping?


Judging from the information I have read about type providers so far, I wonder if they could be used to implement a nice ORM for F#.

I imagine that database rows could be represented by objects with correctly-typed properties, allowing type-safe read and write access to column values, with the type provider implementation automatically checking against the current database schema when compiling.

Is this a realistic and useful scenario?


Solution

  • Yes, that's an interesting use of type providers. One of the examples does just that, see http://msdn.microsoft.com/en-us/library/hh361033(v=vs.110).aspx