Example #1
0
        public async Task <IActionResult> PutEsignals(long id, Esignals esignals)
        {
            if (id != esignals.EsignalsId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Example #2
0
        public async Task <ActionResult <Esignals> > PostEsignals(Esignals esignals)
        {
            _context.Esignals.Add(esignals);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (EsignalsExists(esignals.EsignalsId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetEsignals", new { id = esignals.EsignalsId }, esignals));
        }