//[EnableCors("SiteCorsPolicy")]
        public async Task <IActionResult> PutStatus([FromRoute] int id, [FromBody] Estabelecimento status)
        {
            if (id != status.seq)
            {
                return(BadRequest());
            }

            _context.Entry(status).State = EntityState.Modified;

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

            return(NoContent());
        }
示例#2
0
        public async Task <IActionResult> PutEstabelecimento([FromBody] Estabelecimento estabelecimento)
        {
            _context.Entry(estabelecimento).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EstabelecimentoExists(estabelecimento.seq))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutCategoria([FromBody] Categoria categoria)
        {
            _context.Entry(categoria).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CategoriaExists(categoria.seq))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#4
0
 public void AtualizaEstabelecimento(Estabelecimento estabelecimento)
 {
     _dbContext.Entry(estabelecimento).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     Save();
 }