public async Task<IActionResult> Get(string key) { if (!await _permissionService.Authorize(PermissionSystemName.Products)) return Forbid(); var product = await _productApiService.GetById(key); if (product == null) return NotFound(); return Ok(product); }
public IActionResult Get(string key) { if (!_permissionService.Authorize(PermissionSystemName.Products)) { return(Forbid()); } var product = _productApiService.GetById(key); if (product == null) { return(NotFound()); } return(Ok(product)); }