Пример #1
0
        public async Task <IActionResult> PutCategoriaLancamento(int id, CategoriaLancamento categoriaLancamento)
        {
            categoriaLancamento.Id = id;
            _context.Entry(categoriaLancamento).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CategoriaLancamentoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #2
0
        public async Task <ActionResult <CategoriaLancamento> > PostCategoriaLancamento(CategoriaLancamento categoriaLancamento)
        {
            _context.CategoriaLancamentos.Add(categoriaLancamento);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCategoriaLancamento", new { id = categoriaLancamento.Id }, categoriaLancamento));
        }