Apply() 공개 메소드

Applies a modification to the member map.
public Apply ( BsonMemberMap memberMap ) : void
memberMap BsonMemberMap The member map.
리턴 void
 public void TestMemberNameElementNameConvention()
 {
     var convention = new MemberNameElementNameConvention();
     var classMap = new BsonClassMap<TestClass>();
     convention.Apply(classMap.MapMember(x => x.FirstName));
     convention.Apply(classMap.MapMember(x => x.Age));
     convention.Apply(classMap.MapMember(x => x._DumbName));
     convention.Apply(classMap.MapMember(x => x.lowerCase));
     Assert.AreEqual("FirstName", classMap.GetMemberMap(x => x.FirstName).ElementName);
     Assert.AreEqual("Age", classMap.GetMemberMap(x => x.Age).ElementName);
     Assert.AreEqual("_DumbName", classMap.GetMemberMap(x => x._DumbName).ElementName);
     Assert.AreEqual("lowerCase", classMap.GetMemberMap(x => x.lowerCase).ElementName);
 }
        public void TestMemberNameElementNameConvention()
        {
            var convention = new MemberNameElementNameConvention();
            var classMap = new BsonClassMap<TestClass>();
            var firstName = classMap.MapMember(x => x.FirstName);
            var age = classMap.MapMember(x => x.Age);
            var _dumbName = classMap.MapMember(x => x._DumbName);
            var lowerCase = classMap.MapMember(x => x.lowerCase);

            convention.Apply(firstName);
            convention.Apply(age);
            convention.Apply(_dumbName);
            convention.Apply(lowerCase);

            Assert.Equal("FirstName", firstName.ElementName);
            Assert.Equal("Age", age.ElementName);
            Assert.Equal("_DumbName", _dumbName.ElementName);
            Assert.Equal("lowerCase", lowerCase.ElementName);
        }