Beispiel #1
0
        public async Task <IActionResult> PutEnderecoInstalacao(int id, EnderecoInstalacao enderecoInstalacao)
        {
            if (id != enderecoInstalacao.EnderecoId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Beispiel #2
0
        public async Task <ActionResult <EnderecoInstalacao> > PostEnderecoInstalacao(EnderecoInstalacao enderecoInstalacao)
        {
            _context.EnderecosInstalacao.Add(enderecoInstalacao);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEnderecoInstalacao", new { id = enderecoInstalacao.EnderecoId }, enderecoInstalacao));
        }