Exemplo n.º 1
0
        public async Task <int> Add(Core.CoreModels.Question newQuestion)
        {
            if (newQuestion is null)
            {
                throw new ArgumentNullException(nameof(newQuestion));
            }

            var newQuestionEntity = _mapper.Map <Core.CoreModels.Question, Entities.Question>(newQuestion);

            await _context.AddAsync(newQuestionEntity);

            await _context.SaveChangesAsync();

            return(newQuestionEntity.Id);
        }