public async Task<IActionResult> Post([FromBody] ProductDto model) { if (!await _permissionService.Authorize(PermissionSystemName.Products)) return Forbid(); if (ModelState.IsValid) { model = await _productApiService.InsertOrUpdateProduct(model); return Created(model); } return BadRequest(ModelState); }
public IActionResult Post([FromBody] ProductDto model) { if (!_permissionService.Authorize(PermissionSystemName.Products)) { return(Forbid()); } if (ModelState.IsValid) { model = _productApiService.InsertOrUpdateProduct(model); return(Created(model)); } return(BadRequest(ModelState)); }