Beispiel #1
0
        public Result Create(QuizQuestionCreateAdminDto dto)
        {
            var result = _validatorCreate.ValidateResult(dto);

            if (!result.Success)
            {
                return(result);
            }

            var entity = Mapper.Map <QuizQuestion>(dto);

            entity.IsActive = true;

            _quizQuestionRepository.Insert(entity);
            _unitOfWork.Commit();

            QuizQuestionCacheManager.ClearCache();

            result.Id = entity.Id;

            return(result.SetSuccess(Messages.RecordSaved));
        }
 public IHttpActionResult Post([FromBody] QuizQuestionCreateAdminDto dto)
 {
     return(Result(_quizQuestionAdminService.Create(dto)));
 }