Esempio n. 1
0
        public async Task <IActionResult> GetDoctors([FromQuery] string name, [FromQuery] DoctorSpecializations?spec,
                                                     [FromQuery] string orgId, [FromQuery] string sort, [FromQuery] int page = 1,
                                                     [FromQuery] int limit = 30)
        {
            var(count, users) = await _userService.GetDoctors(name, page, limit, spec, orgId, sort);

            var response = new ResponseData(users);

            response.AddPaginationData(count, page, limit);
            return(Ok(response));
        }
Esempio n. 2
0
        public async Task <IActionResult> GetAsync(
            [FromQuery(Name = "search")] string searchRequest,
            [FromQuery(Name = "ids")] string idsRequest,
            [FromQuery] ICPC2Groups?groupId,
            [FromQuery] bool?isActive,
            [FromQuery] int page  = 1,
            [FromQuery] int?limit = 30)
        {
            var ids = new HashSet <string>();

            if (!string.IsNullOrEmpty(idsRequest))
            {
                ids = idsRequest.Split(',', StringSplitOptions.RemoveEmptyEntries)
                      .ToHashSet();
            }

            var elements = await GetCodesAsync(searchRequest, ids, groupId, isActive, page, limit);

            var response = new ResponseData(elements.data);

            response.AddPaginationData(elements.count, page, limit.Value);
            return(Ok(response));
        }