Esempio n. 1
0
 public override void Map(BsonClassMap <QueryConfig> cm)
 {
     cm.AutoMap();
     //every doc has to have an id
     cm.MapIdField(x => x.Id).SetIdGenerator(StringObjectIdGenerator.Instance)
     .SetSerializer(new StringSerializer(BsonType.ObjectId));
 }
 public override void Map(BsonClassMap <ApiResource> cm)
 {
     cm.AutoMap();
     cm.MapIdField(x => x.Id);
     //cm.GetMemberMap(x=>x.Description)
     cm.SetIgnoreExtraElements(true);
 }
Esempio n. 3
0
        public void SetupBsonMapping(BsonClassMap <SRecipe> document)
        {
            document.AutoMap();

            // Use the id for the auto-generated db id.
            // Reserve the identifier field for the original url of the schema object.
            document.MapIdField(x => x.Id);
        }
Esempio n. 4
0
 public static BsonClassMap <TClass> MapCallistoId <TClass>(this BsonClassMap <TClass> map) where TClass : class, IDocumentRoot
 {
     map.MapIdField(a => a.Id)
     .SetIdGenerator(new GuidGenerator())
     .SetIsRequired(true)
     .SetSerializer(new GuidSerializer())
     .SetOrder(0)
     .SetElementName("_id");
     return(map);
 }
        public override void Map(BsonClassMap <MyClass> cm)
        {
            cm.AutoMap();

            //every doc has to have an id
            cm.MapIdField(x => x.Id).SetIdGenerator(new StringObjectIdGenerator());

            cm.MapProperty(x => x.SomeProperty)
            .SetElementName("sp");     // will set the element name to "sp" in the stored documents

            //unmap the property.. now we won't save it
            cm.UnmapProperty(x => x.SomeOtherProperty);
        }
        public override void Map(BsonClassMap <Todo> cm)
        {
            cm.AutoMap();

            //every doc has to have an id
            cm.MapIdField(x => x.Id);
            cm.MapProperty(x => x.State);
            cm.MapProperty(x => x.IsDone);
            cm.SetIgnoreExtraElements(true);


            // will set the element name to "sp" in the stored documents

            //unmap the property.. now we won't save it
        }
Esempio n. 7
0
 public override void Map(BsonClassMap <Tenant> cm)
 {
     cm.AutoMap();
     cm.MapIdField(x => x.Id);
     cm.SetIgnoreExtraElements(true);
 }
Esempio n. 8
0
 protected override void MapEntity(BsonClassMap <Vehicle> cm)
 {
     cm.MapIdField(x => x.Id).SetIdGenerator(this.IdGenerator);
     cm.UnmapProperty(x => x.DateOfProduction);
     cm.AutoMap();
 }
Esempio n. 9
0
 public void SetupBsonMapping(BsonClassMap <Thing> document)
 {
     document.AutoMap();
     document.MapIdField(x => x.Identifier);
 }
Esempio n. 10
0
 protected override void MapEntity(BsonClassMap <Person> cm)
 {
     cm.MapIdField(x => x.Id).SetIdGenerator(new ObjectIdGenerator());
     cm.MapProperty(x => x.Name);
     cm.MapProperty(x => x.Age);
 }
Esempio n. 11
0
 public override void Map(BsonClassMap <IdentityUserRole> cm)
 {
     cm.AutoMap();
     cm.MapIdField(x => x.Id);
     cm.SetIgnoreExtraElements(true);
 }