public async Task <GenericResponse> CreateCard(CardAppModel cardAppModel) { var card = cardAppModel.ToEntity(); var cardId = await _cardService.CreateCardAsync(card); await _unitOfWork.CommitAsync(); return(new GenericResponse { Id = cardId }); }
public static Card ToEntity(this CardAppModel model) { return(Mapper.Map <Card>(model)); }
public async Task <ActionResult <GenericResponse> > CreateCardAsync([FromBody] CardAppModel cardAppModel) { var cardId = await _cardsApplicationService.CreateCard(cardAppModel); return(new OkObjectResult(cardId)); }