public async Task CreateExam(CreateExamsViewModel createExams) { Exam exam = new Exam { CourseID = createExams.CourseID, CreatedBy = createExams.CreatedBy, DateCreated = DateTime.Now, ExamName = createExams.ExamNo, ExamType = createExams.ExamType, ExamNo = createExams.ExamNo, PassScore = createExams.PassMark }; await _examsRepo.CreateExams(exam); }
public async Task <ResponseBase> CreateExam([FromQuery] CreateExamsViewModel model) { try { GetUserId(); model.CreatedBy = UserId; await _examsAppService.CreateExam(model); return(new ResponseBase() { IsSuccess = true, ErrorDetails = null }); } catch (Exception ex) { LogError(ex); return(new ResponseBase() { ErrorDetails = Error(), IsSuccess = false }); } }