/// with WebApi 1 IHttpActionResult public HttpResponseMessage Post([FromBody] DriversTable value) { CtaxiDb.DriversTable.Add(value); CtaxiDb.SaveChanges(); return(ToJson(true)); }
public HttpResponseMessage Delete(int id) { CtaxiDb.DriversTable.Remove(CtaxiDb.DriversTable.FirstOrDefault(x => x.Id == id)); CtaxiDb.SaveChanges(); return(ToJson(true)); }
public HttpResponseMessage Put([FromBody] DriversTable value) { CtaxiDb.Entry(value).State = EntityState.Modified; CtaxiDb.SaveChanges(); return(ToJson(true)); }