예제 #1
0
        //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);
        }
예제 #2
0
 public void CreateCard(CardDTO cardDTO)
 {
     Mapper.Initialize(cfg => cfg.CreateMap <CardDTO, Card>());
     Database.Cards.Create(Mapper.Map <CardDTO, Card>(cardDTO));
 }