public async Task <Response> Handle(Request request) { return(new Response() { DigitalAsset = DigitalAssetApiModel.FromDigitalAsset(await _context.DigitalAssets.FindAsync(request.Id)) }); }
public async Task <Response> Handle(Request request) { return(new Response() { DigitalAsset = DigitalAssetApiModel.FromDigitalAsset(await _context.DigitalAssets.SingleAsync(x => x.UniqueId.ToString() == request.UniqueId)) }); }
public async Task <Response> Handle(Request request) { var digitalAssets = await _cache.FromCacheOrServiceAsync <List <DigitalAsset> >(() => _context.DigitalAssets.ToListAsync(), DigitalAssetCacheKeys.DigitalAssets); return(new Response() { DigitalAssets = digitalAssets.Select(x => DigitalAssetApiModel.FromDigitalAsset(x)).ToList() }); }