/// <summary> /// Gets the stores. /// </summary> /// <param name="request">The stores request.</param> /// <returns>The <see cref="Task"/> containing the API response with <see cref="GetStoresResponse"/>.</returns> public virtual Task <ApiResponse <GetStoresResponse> > GetAllAsync(GetStoresRequest request) { if (request == null) { throw new ArgumentNullException(nameof(request)); } var requestContext = PrepareRequestContext().WithQuery(request.Query.Build()); return(CallAsync <GetStoresResponse>(requestContext)); }
public override async Task <GetStoresResponse> GetStores( GetStoresRequest request, ServerCallContext context) { var result = await _mediator.Send(new GetStoresQuery()); var response = new GetStoresResponse(); response.Stores.AddRange(result.ToList()); return(response); }