Logo




Subscribe:
RSS 2.0 | Atom 1.0
Categories:

Sign In


[Giagnocavo]Michael::Write()

# Wednesday, April 28, 2010
FluentNHibernate FSharp update for RTM
I've updated the code we use for FluentNHibernate with F# - using the final versions of both products. It's just some code to fixup F# quotations to LINQ expressions that FluentNHibernate can work with, and type extensions to make it easy to consume from F#.

The FluentNHibernate RTM zip has all the other binaries you need to get started.

I'm building against .NET 4, but the code should work on 2.0 as well.

FluentNHibernate.FSharp.dll (38.5 KB)

FluentNHibernate.FSharp.zip (6.95 KB) Source

And here's the FluentNHibernate sample first project using FluentNHibernate.FSharp:

FirstProject.zip (7.66 KB)

Here's an example of what some mapping code looks like:

type ProductMap() as m = inherit ClassMapQ<Product>() do

    let x = m.DefaultX

    m.Not.LazyLoad()

    (m.IdQ <@ x.Id @>).Done

    (m.MapQ <@ x.Name @>).Done

    (m.MapQ <@ x.Price @>).Done

    (m.HasManyToManyQ <@ seq x.StoresStockedIn @>)

        .LazyLoad()

        .Cascade.All()

        .Inverse()

        .Table("StoreProduct")

        .Done


Code | FSharp
Wednesday, April 28, 2010 9:56:22 PM UTC  #    Comments [0]  |  Trackback

OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview