public async Task <UseCaseResponse <IEnumerable <Asset> > > Execute() { var response = new UseCaseResponse <IEnumerable <Asset> >(); try { var assets = await assetRepository.List(); return(response.SetResult(assets)); } catch (Exception e) { logger.LogError(e.Message, e); return(response.SetInternalServerError("Unexpected error: " + e.Message)); } }
public async Task <UseCaseResponse <bool> > Execute(Guid id) { var response = new UseCaseResponse <bool>(); try { await assetRepository.Delete(id); return(response.SetResult(true)); } catch (Exception e) { logger.LogError(e.Message, e); return(response.SetInternalServerError("Unexpected error: " + e.Message)); } }