//PUT public string Put(int id, [FromBody] string value) { AirConditionerdb b = db.AirConditioners.Find(id); if (b is AirConditionerdb) { b.IncreaseTempriche(); db.Entry(b).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(b.Temprich.ToString()); }
public ActionResult IncreaseTempriche(int?id) { if (id == null) { return(HttpNotFound()); } AirConditionerdb b = db.AirConditioners.Find(id); if (b == null) { return(HttpNotFound()); } if (b is AirConditionerdb) { b.IncreaseTempriche(); db.Entry(b).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } return(RedirectToAction("Index")); }