Пример #1
0
 public void Answer(Answer answer)
 {
     using (AJBAQContext context = new AJBAQContext())
     {
         answer.AnswerTime = DateTime.Now;
         context.Add(_mapper.Map <DAL.Models.Answer>(answer));
         context.SaveChanges();
     }
 }
Пример #2
0
        public Question CreateQuestion(Question question)
        {
            var value = _mapper.Map <DAL.Models.Question>(question);

            using (AJBAQContext context = new AJBAQContext())
            {
                context.Add(value);
                context.SaveChanges();
                return(_mapper.Map <Question>(value));
            }
        }
Пример #3
0
        public User CreateUser(User user)
        {
            var value = _mapper.Map <DAL.Models.User>(user);

            using (AJBAQContext context = new AJBAQContext())
            {
                value.UserId = CreateString(5);
                context.Add(value);
                context.SaveChanges();
                return(_mapper.Map <User>(value));
            }
        }