public string PutUser(int id, [FromBody] udata u) { try { db.Entry(u).State = EntityState.Modified; db.SaveChanges(); return("done"); } catch (Exception ee) { return("error"); } }
public string PostUser([FromBody] udata u) { try { db.udatas.Add(u); db.SaveChanges(); return("done"); } catch (Exception ee) { return("error"); } }
public string DeleteUser(int id) { try { udata u = db.udatas.Find(id); db.udatas.Remove(u); db.SaveChanges(); return("done"); } catch (Exception ee) { return("error"); } }
public HttpResponseMessage Put(int id, [FromBody] udata value) { UserDB.Entry(value).State = EntityState.Modified; return(ToJson(UserDB.SaveChanges())); }
public HttpResponseMessage Post([FromBody] udata value) { UserDB.udatas.Add(value); return(ToJson(UserDB.SaveChanges())); }