コード例 #1
0
 public Models.Shared.RestaurantCollectionType RestaurantCollectionTypeEntityToModel(
     Entities.Shared.RestaurantCollectionType restaurantCollectionType)
 => new MapperConfiguration(cfg => cfg.CreateMap <Entities.Shared.RestaurantCollectionType,
                                                  Models.Shared.RestaurantCollectionType>()
                            .ForMember(c => c.Name, opt => opt.MapFrom(src =>
                                                                       src.CollectionType.Name)))
 .CreateMapper()
 .Map <Models.Shared.RestaurantCollectionType>(restaurantCollectionType);
コード例 #2
0
        public void MapOrderModelToEntity(Models.Shared.RestaurantCollectionType restaurantCollectionTypeMod,
                                          Entities.Shared.RestaurantCollectionType restaurantCollectionTypeEnt)
        {
            var mapper = new MapperConfiguration(configure =>
                                                 configure.CreateMap <Models.Shared.RestaurantCollectionType,
                                                                      Entities.Shared.RestaurantCollectionType>())
                         .CreateMapper();

            mapper.Map(restaurantCollectionTypeMod, restaurantCollectionTypeEnt);
        }