Beispiel #1
0
        public static CardApiModel FromCard(Card card)
        {
            var model = new CardApiModel();

            model.CardId      = card.CardId;
            model.Name        = card.Name;
            model.Description = card.Description;
            return(model);
        }
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Card = CardApiModel.FromCard(await _context.Cards.FindAsync(request.CardId))
 };
Beispiel #3
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Cards = await _context.Cards.Select(x => CardApiModel.FromCard(x)).ToListAsync()
 };