public static BrandCreateDtoModel Map(BrandCreateInputModel brandCreateInputModel) { var brandDtoModel = new BrandCreateDtoModel() { Name = brandCreateInputModel.Name.ToUpper(), ImageAddress = brandCreateInputModel.ImageAddress, }; return(brandDtoModel); }
public static Brand Map(BrandCreateDtoModel brandCreateDtoModel) { var brand = new Brand { Name = brandCreateDtoModel.Name, ImageAddress = brandCreateDtoModel.ImageAddress, }; return(brand); }
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(); }