Пример #1
0
 public void Post(int categoryId, [FromBody] Place place)
 {
     place.CategoryId  = categoryId;
     place.DateCreated = DateTime.Now;
     place.EditDate    = DateTime.Now;
     _db.Places.Add(place);
     _db.SaveChanges();
 }
 public void Post(int placeId, [FromBody] Comment comment)
 {
     comment.DateCreated = DateTime.Now;
     comment.EditDate    = DateTime.Now;
     comment.PlaceId     = placeId;
     _db.Comments.Add(comment);
     _db.SaveChanges();
 }
 public ActionResult SignUp([FromBody] User user)
 {
     _db.Add(user);
     _db.SaveChanges();
     return(Ok("User created"));
 }
Пример #4
0
 public void Post([FromBody] Restaurant restaurant)
 {
     _db.Restaurants.Add(restaurant);
     _db.SaveChanges();
 }
 public void Post([FromBody] Shop shop)
 {
     _db.Shops.Add(shop);
     _db.SaveChanges();
 }
 public void Post([FromBody] Category category)
 {
     _db.Categories.Add(category);
     _db.SaveChanges();
 }