Exemplo n.º 1
0
        public async Task <bool> DeleteInputAnswer(ClientAnswer answer)
        {
            _context.ClientAnswers.Remove(answer);
            var rows = await _context.SaveChangesAsync();

            return(rows > 0);
        }
Exemplo n.º 2
0
        public async Task <ClientAnswer> UpdateInputAnswer(ClientAnswer answer)
        {
            var updatedAnswer = _context.ClientAnswers.Update(answer);
            await _context.SaveChangesAsync();

            return(updatedAnswer.Entity);
        }
Exemplo n.º 3
0
        public async Task <ClientAnswer> InsertInputAnswer(ClientAnswer answer)
        {
            answer.Id = 0;
            var updatedAnswer = await _context.ClientAnswers.AddAsync(answer);

            await _context.SaveChangesAsync();

            return(updatedAnswer.Entity);
        }
        public void Post(ClientAnswer clientAnswer)
        {
            if (clientAnswer == null)
            {
                BadRequest(); return;
            }

            clientAnswerService.Create(clientAnswer);
        }
Exemplo n.º 5
0
        public async Task <ClientAnswer> AddInputAnswer(ClientAnswer answer)
        {
            var result = await _context.ClientAnswers.AddAsync(answer);

            return(result.Entity);
        }