// public methods /// <summary> /// Applies a modification to the member map. /// </summary> /// <param name="memberMap">The member map.</param> public void Apply(BsonMemberMap memberMap) { if (!string.IsNullOrEmpty(_elementName)) { memberMap.SetElementName(_elementName); } memberMap.SetOrder(_order); }
// public methods /// <summary> /// Applies a modification to the member map. /// </summary> /// <param name="memberMap">The member map.</param> public void Apply(BsonMemberMap memberMap) { if (!string.IsNullOrEmpty(_elementName)) { memberMap.SetElementName(_elementName); } memberMap.SetOrder(_order); }
void IMemberMapConvention.Apply(BsonMemberMap memberMap) { string name = memberMap.MemberName; var firstLowercaseIndex = findFirstLowercaseIndex(name); if (firstLowercaseIndex < 0) { memberMap.SetElementName(name.ToLowerInvariant()); } else if (firstLowercaseIndex > 1) { memberMap.SetElementName(name.Substring(0, firstLowercaseIndex - 1).ToLowerInvariant() + name.Substring(firstLowercaseIndex - 1)); } else { base.Apply(memberMap); } }
// public methods /// <summary> /// Applies a modification to the member map. /// </summary> /// <param name="memberMap">The member map.</param> public void Apply(BsonMemberMap memberMap) { memberMap.SetElementName("_id"); memberMap.SetOrder(_order); if (_idGenerator != null) { var idGenerator = (IIdGenerator)Activator.CreateInstance(_idGenerator); // public default constructor required memberMap.SetIdGenerator(idGenerator); } memberMap.ClassMap.SetIdMember(memberMap); }
// public methods /// <summary> /// Applies a modification to the member map. /// </summary> /// <param name="memberMap">The member map.</param> public void Apply(BsonMemberMap memberMap) { memberMap.SetElementName("_id"); memberMap.SetOrder(_order); if (_idGenerator != null) { var idGenerator = (IIdGenerator)Activator.CreateInstance(_idGenerator); // public default constructor required memberMap.SetIdGenerator(idGenerator); } memberMap.ClassMap.SetIdMember(memberMap); }
/// <summary>应用约定</summary> public void Apply(BsonMemberMap memberMap) { memberMap.SetElementName(memberMap.MemberName.ToLower()); }
public void Apply(BsonMemberMap memberMap) { memberMap.SetElementName(memberMap.MemberName.ToSnakeCase()); }
public void Apply(BsonMemberMap memberMap) { memberMap.SetElementName(memberMap.ElementName.ToLowerInvariant()); }
// public methods /// <summary> /// Applies a modification to the member map. /// </summary> /// <param name="memberMap">The member map.</param> public void Apply(BsonMemberMap memberMap) { string name = memberMap.MemberName; name = GetElementName(name); memberMap.SetElementName(name); }
public void Apply(BsonMemberMap memberMap) { var replace = s_seperateWordRegex.Replace(memberMap.ElementName, "_"); memberMap.SetElementName(replace); }
public void Apply(BsonMemberMap memberMap) { string csharpName = memberMap.MemberName; memberMap.SetElementName(MapNameToMongo(csharpName)); }
public void Apply(BsonMemberMap memberMap) => memberMap.SetElementName(SeperateWordRegex.Replace(memberMap.ElementName, "_"));
public void Apply(BsonMemberMap memberMap) { var newName = this.textHelpers.ToJsonPropertyName(memberMap.MemberName); memberMap.SetElementName(newName); }
public void Apply(BsonMemberMap member) { member.SetElementName(member.MemberName.ToRegular()); }
public void Apply(BsonMemberMap memberMap) => memberMap.SetElementName(memberMap.ElementName.ToUpper());
public void Apply(BsonMemberMap memberMap) { var name = _convention.GetElementName(memberMap.MemberInfo); memberMap.SetElementName(name); }
public void Apply(BsonMemberMap memberMap) { string elementName = memberMap.MemberName.Substring(0, 1).ToLower() + memberMap.MemberName.Substring(1); memberMap.SetElementName(elementName); }
// public methods /// <summary> /// Applies a modification to the member map. /// </summary> /// <param name="memberMap">The member map.</param> public void Apply(BsonMemberMap memberMap) { memberMap.SetElementName(memberMap.MemberName); }
public void Apply(BsonMemberMap memberMap) { var name = _convention.GetElementName(memberMap.MemberInfo); memberMap.SetElementName(name); }
public void Apply(BsonMemberMap memberMap) { var elementName = this.GetElementName(memberMap.MemberName); memberMap.SetElementName(elementName); }