ДБ
Size: a a a
ДБ
ДБ
ДБ
AH
AH
type Wraped<'a> = { Payload: 'a }
type Model = { Name: string }
let dbTable =
[ { Payload = { Name = "1" } }
{ Payload = { Name = "2" } }
{ Payload = { Name = "3" } }
{ Payload = { Name = "4" } } ]
module Mongo =
let getCollection<'a>(): 'a seq =
match typeof<'a> with
| t when t = typeof<Model> -> dbTable |> Seq.map (fun x -> unbox x.Payload)
| _ -> failwith "no such table"
let getWrappedCollection<'a>(): Wraped<'a> seq =
match typeof<'a> with
| t when t = typeof<Model> -> dbTable |> Seq.map (fun x -> unbox x)
| _ -> failwith "no such table"
let collection: Model seq = Mongo.getCollection<Model>()
let collectionW: Wraped<Model> seq = Mongo.getWrappedCollection<Model>()
let item: Model = Seq.head collectionДБ
x.GetCollection<'a>() = db.GetCollection<QueueEntry<'a>>(typeof<'a>.Name + "_queue")
ДБ
ДБ
AH
AH
PD
This anonymous record has too many fields. Remove the extra fields [isValid].with- ) для анонимных рекордовPD
with- ) для анонимных рекордовPD
P
ДБ
ДБ