public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     DigitalAssets = await _context.DigitalAssets
                     .Where(x => request.DigitalAssetIds.Contains(x.DigitalAssetId))
                     .Select(x => DigitalAssetApiModel.FromDigitalAsset(x)).ToListAsync()
 };
        public static DigitalAssetApiModel FromDigitalAsset(DigitalAsset digitalAsset)
        {
            var model = new DigitalAssetApiModel();

            model.DigitalAssetId = digitalAsset.DigitalAssetId;
            model.Name           = digitalAsset.Name;
            return(model);
        }
예제 #3
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     DigitalAsset = DigitalAssetApiModel.FromDigitalAsset(await _context.DigitalAssets.FindAsync(request.DigitalAssetId))
 };