public async Task <WebApiResult <IEnumerable <country_states> > > Handle(CountryStateQueryCommand request, CancellationToken cancellationToken) { try { var result = await preminumFinanceRepository.GetCountryStates(); return(new WebApiResult <IEnumerable <country_states> >(result)); } catch (Exception ex) { return(WebApiResult <IEnumerable <country_states> > .Error(ex.Message)); } }
public async Task <ActionResult <IEnumerable <country_states> > > GetCountryState(CountryStateQueryCommand command) { var result = await mediator.Send(command); return(Ok(result)); }
public async Task <ActionResult <IEnumerable <country_states> > > GetCountryState(CountryStateQueryCommand command) { var result = await mediator.Send(command); if (!result.IsValid) { return(BadRequest(result.Errors)); } return(Ok(result.Data)); }
public async Task <IEnumerable <country_states> > Handle(CountryStateQueryCommand request, CancellationToken cancellationToken) { return(await preminumFinanceRepository.GetCountryStates()); }