//Validating answer public bool ValidateAnswer(CardDTO cardDTO) { Mapper.Initialize(cfg => cfg.CreateMap <CardDTO, Card>()); var cardD = Mapper.Map <CardDTO, Card>(cardDTO); var card = Database.Cards.Get(cardD.CardId); if (card.Translate != cardD.Translate) { return(false); } return(true); }
public void CreateCard(CardDTO cardDTO) { Mapper.Initialize(cfg => cfg.CreateMap <CardDTO, Card>()); Database.Cards.Create(Mapper.Map <CardDTO, Card>(cardDTO)); }