public async Task <object> PostCommentsForPlaces(CommentForPlace CommentsForPlaces) { _context.CommentsForPlaces.Add(CommentsForPlaces); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCommentsForPlaces", new { id = CommentsForPlaces.Id }, CommentsForPlaces)); }
public async Task <object> PutCommentsForPlaces(int id, CommentForPlace CommentsForPlaces) { if (id != CommentsForPlaces.Id) { return(BadRequest()); } _context.Entry(CommentsForPlaces).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CommentForPlaceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }