コード例 #1
0
 public HttpResponseMessage Put(int id, [FromBody] TblRestaurante value)
 {
     RestauranteDB.Entry(value).State = EntityState.Modified;
     return(ToJson(RestauranteDB.SaveChanges()));
 }
コード例 #2
0
 public HttpResponseMessage Delete(int id)
 {
     RestauranteDB.TblRestaurantes.Remove(RestauranteDB.TblRestaurantes.FirstOrDefault(x => x.Id == id));
     return(ToJson(RestauranteDB.SaveChanges()));
 }
コード例 #3
0
 public HttpResponseMessage Post([FromBody] TblRestaurante value)
 {
     RestauranteDB.TblRestaurantes.Add(value);
     return(ToJson(RestauranteDB.SaveChanges()));
 }