public void Answer(Answer answer) { using (AJBAQContext context = new AJBAQContext()) { answer.AnswerTime = DateTime.Now; context.Add(_mapper.Map <DAL.Models.Answer>(answer)); context.SaveChanges(); } }
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)); } }
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)); } }