public async Task <IActionResult> IdentityResources(int?page, string search) { ViewBag.Search = search; var identityResourcesDto = await _identityResourceService.GetIdentityResourcesAsync(search, page ?? 1); return(View(identityResourcesDto)); }
public async Task <ActionResult <IdentityResourcesApiDto> > Get(string searchText, int page = 1, int pageSize = 10) { var identityResourcesDto = await _identityResourceService.GetIdentityResourcesAsync(searchText, page, pageSize); var identityResourcesApiDto = identityResourcesDto.ToIdentityResourceApiModel <IdentityResourcesApiDto>(); return(Ok(identityResourcesApiDto)); }
public ActionResult <Pagelist <IdentityResourceListDto> > GetIdentityResources([FromQuery] PageInputDto input) { if (!ModelState.IsValid) { return(BadRequest(ModelStateErrors)); } return(_identityResourceService.GetIdentityResourcesAsync(input)); }
private void SetupIdentityResources() { FieldAsync <IdentityResourceType>("IdentityResource", arguments: new QueryArguments( new QueryArgument <IntGraphType> { Name = "id" } ), resolve: async context => { if (context.HasArgument("id")) { var id = context.GetArgument <int>("id"); var identityResourceDto = await _identityResourceService.GetIdentityResourceAsync(id); var identityResourceApiModel = identityResourceDto.ToIdentityResourceApiModel <IdentityResourceApiDto>(); return(identityResourceApiModel); } return(new ArgumentNullException("id")); } ); FieldAsync <ListGraphType <IdentityResourceType> >("IdentityResources", arguments: new QueryArguments( new QueryArgument <StringGraphType> { Name = "search", DefaultValue = "" }, new QueryArgument <IntGraphType> { Name = "page", DefaultValue = 1 }, new QueryArgument <IntGraphType> { Name = "pageSize", DefaultValue = 10 } ), resolve: async context => { var searchText = context.GetArgument <string>("search"); var page = context.GetArgument <int>("page"); var pageSize = context.GetArgument <int>("pageSize"); var identityResourcesDto = await _identityResourceService.GetIdentityResourcesAsync(searchText, page, pageSize); var identityResourcesApiDto = identityResourcesDto.ToIdentityResourceApiModel <IdentityResourcesApiDto>(); return(identityResourcesApiDto.IdentityResources); } ); FieldAsync <IdentityResourceType>("IdentityResourceProperty", arguments: new QueryArguments( new QueryArgument <IntGraphType> { Name = "id" } ), resolve: async context => { if (context.HasArgument("id")) { var id = context.GetArgument <int>("id"); var identityResourcePropertiesDto = await _identityResourceService.GetIdentityResourcePropertyAsync(id); var identityResourcePropertyApiDto = identityResourcePropertiesDto.ToIdentityResourceApiModel <IdentityResourcePropertyApiDto>(); return(identityResourcePropertyApiDto); } return(new ArgumentNullException("id")); } ); FieldAsync <ListGraphType <IdentityResourceType> >("IdentityResourcesProperties", arguments: new QueryArguments( new QueryArgument <IntGraphType> { Name = "id" }, new QueryArgument <IntGraphType> { Name = "page", DefaultValue = 1 }, new QueryArgument <IntGraphType> { Name = "pageSize", DefaultValue = 10 } ), resolve: async context => { if (context.HasArgument("id")) { var id = context.GetArgument <int>("id"); var page = context.GetArgument <int>("page"); var pageSize = context.GetArgument <int>("pageSize"); var identityResourcePropertiesDto = await _identityResourceService.GetIdentityResourcePropertiesAsync(id, page, pageSize); var identityResourcePropertiesApiDto = identityResourcePropertiesDto.ToIdentityResourceApiModel <IdentityResourcePropertiesApiDto>(); return(identityResourcePropertiesApiDto.IdentityResourceProperties); } return(new ArgumentNullException("id")); } ); }
public async Task <ActionResult <JsonResponse <IEnumerable <IdentityResourceViewModel> > > > Get() { var resources = await _identityResourceService.GetIdentityResourcesAsync(); return(JsonResponse(resources)); }
public Task <PaginationResult <IdentityResourceDto> > GetIdentityResourcesAsync(int?skip, int?take, string search) { return(identityResourceService.GetIdentityResourcesAsync(skip, take, search)); }