Beispiel #1
0
 public override void Map(BsonClassMap <DiarySettingsPeriodDTO> cm)
 {
     cm.AutoMap();
     cm.MapCreator(d => new DiarySettingsPeriodDTO(d.School, d.IsGuarianAllowedToSendMessage, d.MealSettingPeriods, d.NapSettingPeriods, d.MyDayPeriods, d.MyPopInfos));
     cm.SetIgnoreExtraElements(true);
     MapNestedObjects();
 }
Beispiel #2
0
        protected override void Configure(BsonClassMap <TTN> builder)
        {
            builder.AutoMap();

            builder.MapCreator(x => new TTN(x.Value));

            builder.MapProperty(x => x.Value);
        }
        public void Apply_should_do_nothing_when_member_info_is_null()
        {
            var subject = new NamedParameterCreatorMapConvention();
            var classMap = new BsonClassMap<C>();
            var @delegate = (Func<int, C>)(y => new C(y));
            var creatorMap = classMap.MapCreator(@delegate);
            creatorMap.Arguments.Should().BeNull();
            creatorMap.MemberInfo.Should().BeNull();

            subject.Apply(creatorMap);

            creatorMap.Arguments.Should().BeNull();
        }
Beispiel #4
0
        public void Apply_should_do_nothing_when_member_info_is_null()
        {
            var subject    = new NamedParameterCreatorMapConvention();
            var classMap   = new BsonClassMap <C>();
            var @delegate  = (Func <int, C>)(y => new C(y));
            var creatorMap = classMap.MapCreator(@delegate);

            creatorMap.Arguments.Should().BeNull();
            creatorMap.MemberInfo.Should().BeNull();

            subject.Apply(creatorMap);

            creatorMap.Arguments.Should().BeNull();
        }
 public override void Map(BsonClassMap <LastName> cm)
 {
     cm.MapCreator(x => new LastName(x.Value));
 }
 public override void Map(BsonClassMap <Behavior> cm)
 {
     cm.MapCreator(x => new Behavior(x.Id, x.Name));
 }
 public override void Map(BsonClassMap <BlockType> cm)
 {
     cm.MapCreator(x => new BlockType(x.Id, x.Name));
 }