Пример #1
0
        public IActionResult EditManufacturer(EditManufacturerRequest manufacturerRequest)
        {
            var manufacturerToUpdate = _mapper.Map <ManufacturerDto>(manufacturerRequest);

            _manufacturerService.UpdateManufacturer(manufacturerToUpdate);
            return(Ok());
        }
Пример #2
0
 public static Manufacturer ToManufacturerModel(this EditManufacturerRequest request)
 {
     return(new Manufacturer
     {
         Name = request.Name
     });
 }
Пример #3
0
        //[Authorize(Roles = "publisher")]
        public async Task <ActionResult> EditManufacturer(int manufacturerId, [FromBody] EditManufacturerRequest request)
        {
            var publisherModel = request.ToManufacturerModel();

            await _manufacturerService.Edit(manufacturerId, publisherModel);

            return(Ok());
        }