public async Task <DataProfileResult[]> GetProfileSearch(ProfileSearchRequestBody requestBody) { var request = new ProfileSearchRequest { Body = requestBody }; var client = await Connect(); var response = (await client.ProfileSearchAsync(request))?.Body; if (!string.IsNullOrEmpty(response?.error_msg)) { throw new Exception(response.error_msg); } var responseResult = response?.ProfileSearchResult; if (responseResult?.Length > 0) { ((IClientChannel)client).Close(); } return(responseResult); }
public async Task <ActionResult> GetProfile([FromQuery] ProfileSearchRequestQuery query, [FromBody] ProfileSearchRequestBody body, CancellationToken cancellationToken) { var result = await _mediator.Send( new List.Query { Page = query.Page, SortBy = query.SortBy, SortField = query.SortField, SearchRequestBody = body }, cancellationToken); if (result == null) { return(NotFound()); } return(Ok(result)); }