Ejemplo n.º 1
0
        public static BrandCreateDtoModel Map(BrandCreateInputModel brandCreateInputModel)
        {
            var brandDtoModel = new BrandCreateDtoModel()
            {
                Name         = brandCreateInputModel.Name.ToUpper(),
                ImageAddress = brandCreateInputModel.ImageAddress,
            };

            return(brandDtoModel);
        }
Ejemplo n.º 2
0
        public static Brand Map(BrandCreateDtoModel brandCreateDtoModel)
        {
            var brand = new Brand
            {
                Name         = brandCreateDtoModel.Name,
                ImageAddress = brandCreateDtoModel.ImageAddress,
            };

            return(brand);
        }
Ejemplo n.º 3
0
        public async Task CreateBrand(BrandCreateDtoModel brandCreateDtoModel)
        {
            if (brandCreateDtoModel.ImageAddress == null)
            {
                brandCreateDtoModel.ImageAddress = GlobalConstants.ImageAddress;
            }

            var brand = BrandServiceCreateMapper.Map(brandCreateDtoModel);

            await this.brands.AddAsync(brand);

            await this.brands.SaveChangesAsync();
        }