コード例 #1
0
        public IPropertyMapsBuilder <TSource, TReceiver> For <TReceiverMember>(Expression <Func <TReceiver, TReceiverMember> > member, Action <IMappingActionsBuilder <TSource, TReceiverMember> > setupAction)
        {
            var propertyMapBuilder = new PropertyMapBuilder <TSource, TReceiver, TReceiverMember>();
            var propertyMap        = propertyMapBuilder
                                     .AddMember(member)
                                     .AddSetupAction(setupAction)
                                     .Build();

            _propertyMaps.RemoveAll(x => x.ReceiverProperty.Equals(propertyMap.ReceiverProperty));
            _propertyMaps.Add(propertyMap);

            return(this);
        }
コード例 #2
0
ファイル: ProfileMapBuilder.cs プロジェクト: ivbobkov/mapper
        public IProfileMapBuilder <TSource, TReceiver> For <TReceiverMember>(
            Expression <Func <TReceiver, TReceiverMember> > member,
            Action <IMappingActionsBuilder <TSource, TReceiverMember> > setupAction)
        {
            var propertyMapBuilder = new PropertyMapBuilder <TSource, TReceiver, TReceiverMember>();
            var propertyMap        = propertyMapBuilder
                                     .AddMember(member)
                                     .AddSetupAction(setupAction)
                                     .Build();

            AddOrReplacePropertyMap(propertyMap);

            return(this);
        }