Example #1
0
        public async Task <IActionResult> PutPadrao(int id, Padrao padrao)
        {
            if (id != padrao.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <IActionResult> PutUnidade(int id, Unidade unidade)
        {
            if (id != unidade.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #3
0
        public async Task <IActionResult> PutAmostra(int id, Amostra amostra)
        {
            if (id != amostra.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }