public async Task <IEnumerable <CustomerDto> > Query(CustomersSearchQueryDto model)
        {
            var query  = Mapper.Map(model).ToANew <CustomerSeachQuery>();
            var result = await dispatcher.Query <CustomerSeachQuery, IEnumerable <Customer> >(query);

            return(Mapper.Map(result).ToANew <IEnumerable <CustomerDto> >());
        }
        public async Task <IActionResult> Query([FromBody] CustomersSearchQueryDto query)
        {
            var result = await customerApplication.Query(query);

            return(result.IsNotNull() ? (IActionResult)Ok(result) : NotFound());
        }
Beispiel #3
0
 public CustomersSearchAction(CustomersSearchQueryDto query)
 {
     Query = query;
 }
 public async Task <IEnumerable <CustomerDto> > Query(CustomersSearchQueryDto query)
 {
     return(await requestService.PostAsync <CustomersSearchQueryDto, List <CustomerDto> >(
                $"{apiSettings.SalesUrl}/{Endpoint}/query", query));
 }