public async Task <IActionResult> AddApiResourceClaimAsync(string subject, ApiResourceClaimValue model) { if (string.IsNullOrWhiteSpace(subject)) { ModelState["subject.String"].Errors.Clear(); ModelState.AddModelError("", Messages.SubjectRequired); } if (model == null) { ModelState.AddModelError("", "Model required"); } if (ModelState.IsValid) { var result = await _service.AddClaimAsync(subject, model.Type); if (result.IsSuccess) { return(NoContent()); } ModelState.AddErrors(result); } return(BadRequest(ModelState.ToError())); }