//[ValidationAspect(typeof(ExamValidator), Priority = 1)] //[CacheRemoveAspect("IExamService.Get")] public IResult Add(ExamDto examDto) { var exam = new Exam { Title = examDto.Title, Information = examDto.Information, NumberOfQuestions = examDto.NumberOfQuestions, AddedAt = DateTime.Now, StartTime = DateTime.Parse(examDto.StartTime), EndTime = DateTime.Parse(examDto.EndTime) }; IResult result = BusinessRules.Run(CheckIfExamNameExists(exam.Title)); if (result != null) { return(result); } _examDal.Add(exam); return(new SuccessResult(Messages.ExamAdded)); }
public void Add(ExamDto examDto) { var exam = new Exam { Title = examDto.Title, Information = examDto.Information, NumberOfQuestions = examDto.NumberOfQuestions, AddedAt = DateTime.Now, StartTime = DateTime.Parse(examDto.StartTime), EndTime = DateTime.Parse(examDto.EndTime) }; _examDal.Add(exam); }
public void Add(Exam entity) { _examDal.Add(entity); }