public IActionResult EditManufacturer(EditManufacturerRequest manufacturerRequest) { var manufacturerToUpdate = _mapper.Map <ManufacturerDto>(manufacturerRequest); _manufacturerService.UpdateManufacturer(manufacturerToUpdate); return(Ok()); }
public static Manufacturer ToManufacturerModel(this EditManufacturerRequest request) { return(new Manufacturer { Name = request.Name }); }
//[Authorize(Roles = "publisher")] public async Task <ActionResult> EditManufacturer(int manufacturerId, [FromBody] EditManufacturerRequest request) { var publisherModel = request.ToManufacturerModel(); await _manufacturerService.Edit(manufacturerId, publisherModel); return(Ok()); }