示例#1
0
        public async Task <ActionResult <CatAseguradoras> > PostCatAseguradoras(CatAseguradoras catAseguradoras)
        {
            _context.CatAseguradoras.Add(catAseguradoras);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCatAseguradoras", new { id = catAseguradoras.IdAseguradora }, catAseguradoras));
        }
示例#2
0
        public async Task <IActionResult> PutCatAseguradoras(int id, CatAseguradoras catAseguradoras)
        {
            if (id != catAseguradoras.IdAseguradora)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }