Example #1
0
        /// with WebApi 1 IHttpActionResult

        public HttpResponseMessage Post([FromBody] DriversTable value)
        {
            CtaxiDb.DriversTable.Add(value);
            CtaxiDb.SaveChanges();

            return(ToJson(true));
        }
Example #2
0
 public HttpResponseMessage Delete(int id)
 {
     CtaxiDb.DriversTable.Remove(CtaxiDb.DriversTable.FirstOrDefault(x => x.Id == id));
     CtaxiDb.SaveChanges();
     return(ToJson(true));
 }
Example #3
0
 public HttpResponseMessage Put([FromBody] DriversTable value)
 {
     CtaxiDb.Entry(value).State = EntityState.Modified;
     CtaxiDb.SaveChanges();
     return(ToJson(true));
 }