public IHttpActionResult PostTemperatureModel(TemperatureModel temperatureModel)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

                db.Table.Add(temperatureModel);
                db.SaveChanges();

            return CreatedAtRoute("DefaultApi", new { id = temperatureModel.Id }, temperatureModel);
        }
        public IHttpActionResult PutTemperatureModel(int id, TemperatureModel temperatureModel)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != temperatureModel.Id)
            {
                return BadRequest();
            }

               // db.Entry(temperatureModel).State = EntityState.Modified;
               db.MarkAsModified(temperatureModel);
            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TemperatureModelExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
 public void MarkAsModified(TemperatureModel item)
 {
 }
 //protected override void OnModelCreating(DbModelBuilder modelBuilder)
 //{
 //}
 public void MarkAsModified(TemperatureModel item)
 {
     Entry(item).State = EntityState.Modified;
 }