public async Task <IActionResult> GetApiResourceAsync(string subject) { if (string.IsNullOrWhiteSpace(subject)) { ModelState["subject.String"].Errors.Clear(); ModelState.AddModelError("", Messages.SubjectRequired); } if (!ModelState.IsValid) { return(BadRequest(ModelState.ToError())); } var result = await _service.GetAsync(subject); if (result.IsSuccess) { if (result.Result == null) { return(NotFound()); } var meta = await GetCoreMetaDataAsync(); return(Ok(new ApiResourceDetailResource(result.Result, Url, meta))); } return(BadRequest(result.ToError())); }
public async Task GetApiResource() { IApiResourceService service = Startup.CreateCluster().GrainFactory.GetGrain <IApiResourceService>(1); var r = await service.GetAsync(); }
public async Task <ActionResult <ApiResourceDTO> > GetApiResourceAsync(int id) { var result = await apiResourceService.GetAsync(id); return(Ok(result)); }
public async Task <IActionResult> GetApiResources(int page = 1, int pageSize = 10) { var apiResources = await _apiResourceService.GetAsync(page, pageSize); return(Ok(apiResources)); }