Exemple #1
0
        public async Task <ActionResult <EsSerialActive> > PostEsSerialActive(EsSerialActive esSerialActive)
        {
            _context.EsSerialActive.Add(esSerialActive);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEsSerialActive", new { id = esSerialActive.id }, esSerialActive));
        }
Exemple #2
0
        public async Task <IActionResult> PutEsSerialActive(int id, EsSerialActive esSerialActive)
        {
            if (id != esSerialActive.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }