public async Task <IActionResult> PutConsuming(int id, Consuming consuming)
        {
            if (id != consuming.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
示例#2
0
        public async Task <IActionResult> PutTemprature(int id, Temprature temprature)
        {
            if (id != temprature.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }