public HttpResponseMessage create(Notification_tb nottif) { try { var res = new HttpResponseMessage(HttpStatusCode.OK); db.Notification_tb.Add(nottif); db.SaveChanges(); return(res); } catch { return(new HttpResponseMessage(HttpStatusCode.BadRequest)); } }
public HttpResponseMessage Update(Notification_tb notifi) { try { var res = new HttpResponseMessage(HttpStatusCode.OK); var newNotification = db.Notification_tb.Single(p => p.id == notifi.id); newNotification.id = notifi.id; newNotification.subjec = notifi.subjec; newNotification.content = notifi.content; newNotification.lang = notifi.lang; db.SaveChanges(); return(res); } catch { return(new HttpResponseMessage(HttpStatusCode.BadRequest)); } }