Esempio n. 1
0
        public WoodTypeService()
        {
            _woodTypeRepository = new WoodTypeRepository(new WoodWorkshopContext());

            var mapperConfig = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <WoodTypeModel, WoodType>().ReverseMap();
            });

            _mapper = new Mapper(mapperConfig);
        }
        public WoodWorkshopService()
        {
            _woodWorkshopRepository  = new WoodWorkshopRepository <WoodFurnitureOrder>(new WoodWorkshopContext());
            _woodTypeRepository      = new WoodTypeRepository(new WoodWorkshopContext());
            _furnitureTypeRepository = new FurnitureTypeRepository(new WoodWorkshopContext());

            var mapperConfig = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <WoodFurnitureOrderModel, WoodFurnitureOrder>().ReverseMap();
                cfg.CreateMap <FurnitureTypeModel, FurnitureType>().ReverseMap();
                cfg.CreateMap <WoodTypeModel, WoodType>().ReverseMap();
                cfg.CreateMap <CustomerModel, Customer>().ReverseMap();
                cfg.CreateMap <EpoxyModel, Epoxy>().ReverseMap();
            });

            _mapper = new Mapper(mapperConfig);
        }