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