public ConfigSetting PostConfig(ConfigSetting c) { var cfg = db.ConfigSettings.Find(c.Id); if (cfg != null) { db.Entry(cfg).CurrentValues.SetValues(c); db.SaveChanges(); return(cfg); } return(c); }
public HttpResponseMessage PostTranslation(WeatherTranslation w) { var wt = db.WeatherTranslations.Find(w.Id); if (wt == null) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "not found")); } db.Entry(wt).CurrentValues.SetValues(w); db.SaveChanges(); return(Request.CreateResponse(HttpStatusCode.OK, "updated")); }