How do I use the fluent mapping support. I cannot seem to get it to work properly.
I define the mapping below since the object dont have an ID property but that doesnt work when inserting the document to the database.
I I used BSonmapper then the fluent mapping works but it doesnt support the fsharp types.
let createDatabaseUsing (store:Store) (config:AppSettings) =
let mapper = FSharpBsonMapper()
mapper.Entity<ServiceRequestAssignment>().Id(fun a -> a.RequestId) |> ignore
mapper.Entity<SpSite>().Id(fun a -> a.SiteUrl) |> ignore
let db =
match store with
| Store.InMemory ->
let memoryStream = new MemoryStream()
new LiteDatabase(memoryStream, mapper)
| Store.LocalDatabase ->
let dbFile = config.Database.File
new LiteDatabase(dbFile, mapper)
db
Hi
How do I use the fluent mapping support. I cannot seem to get it to work properly. I define the mapping below since the object dont have an ID property but that doesnt work when inserting the document to the database. I I used BSonmapper then the fluent mapping works but it doesnt support the fsharp types.
Exception
Could you suggest what I am doing wrong here?