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); }
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); }
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 }
public override void Map(BsonClassMap <Tenant> cm) { cm.AutoMap(); cm.MapIdField(x => x.Id); cm.SetIgnoreExtraElements(true); }
protected override void MapEntity(BsonClassMap <Vehicle> cm) { cm.MapIdField(x => x.Id).SetIdGenerator(this.IdGenerator); cm.UnmapProperty(x => x.DateOfProduction); cm.AutoMap(); }
public void SetupBsonMapping(BsonClassMap <Thing> document) { document.AutoMap(); document.MapIdField(x => x.Identifier); }
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); }
public override void Map(BsonClassMap <IdentityUserRole> cm) { cm.AutoMap(); cm.MapIdField(x => x.Id); cm.SetIgnoreExtraElements(true); }