public async Task <IActionResult> GetById(Guid id) { var query = new GetCardByIdQuery(id); var queryResult = await queryDispatcher.ExecuteAsync(query); if (queryResult == null) { return(BadRequest(id)); } var resonse = new GetCardViewReponse() { CardHolder = queryResult.CardHolder, ExpirationDate = queryResult.ExpirationDate, Id = queryResult.Id, Number = queryResult.Number }; return(Ok(resonse)); }
/// <summary> /// /// </summary> public async Task <CardOutput> GetByIdAsync(string id) { var query = new GetCardByIdQuery(id); return(await SendQueryAsync <GetCardByIdQuery, CardOutput>(query)); }