Exemplo n.º 1
0
        public async Task <Guid> AddSurvey(SurveyVm viewModel)
        {
            await _modelValidator.ValidateAsync <SurveyVm, SurveyVmValidator>(viewModel);

            var model = _objectMapper.Map <SurveyVm, Core.Model.Survey>(viewModel);

            model.SurveyStatus = Core.Enum.SurveyStatus.BeingEntered;
            _appRepository.Create(model);
            await _appRepository.SaveAsync();

            return(model.Id);
        }
Exemplo n.º 2
0
        public async Task <AkselModel> AddAsync(AkselModel model)
        {
            await _modelValidator.ValidateAsync(model);

            AkselEntity entity = _mapper.Map <AkselEntity>(model);
            EntityEntry <AkselEntity> AkselEntity = await _AkselRepository.AddAsync(entity);

            await _unitOfWork.SaveChangesAsync();

            AkselModel AkselModel = _mapper.Map <AkselModel>(AkselEntity.Entity);

            return(AkselModel);
        }
Exemplo n.º 3
0
        public async Task <Guid> Add(PalindromeVm viewModel)
        {
            await _modelValidator.ValidateAsync <PalindromeVm, PalindromeVmValidator>(viewModel);

            var model = _objectMapper.Map <PalindromeVm, PalindromeModel>(viewModel);

            _appRepository.Create(model);
            await _appRepository.SaveAsync();

            return(model.Id);
        }