Ejemplo 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));
 }
Ejemplo n.º 2
0
 public override void Map(BsonClassMap <ApiResource> cm)
 {
     cm.AutoMap();
     cm.MapIdField(x => x.Id);
     //cm.GetMemberMap(x=>x.Description)
     cm.SetIgnoreExtraElements(true);
 }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 6
0
        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
        }
Ejemplo n.º 7
0
 public override void Map(BsonClassMap <Tenant> cm)
 {
     cm.AutoMap();
     cm.MapIdField(x => x.Id);
     cm.SetIgnoreExtraElements(true);
 }
Ejemplo 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();
 }
Ejemplo n.º 9
0
 public void SetupBsonMapping(BsonClassMap <Thing> document)
 {
     document.AutoMap();
     document.MapIdField(x => x.Identifier);
 }
Ejemplo 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);
 }
Ejemplo n.º 11
0
 public override void Map(BsonClassMap <IdentityUserRole> cm)
 {
     cm.AutoMap();
     cm.MapIdField(x => x.Id);
     cm.SetIgnoreExtraElements(true);
 }