public async Task <IActionResult> PutLocation([FromRoute] int id, [FromBody] Location location) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != location.ID) { return(BadRequest()); } _context.Entry(location).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LocationExists(id)) { return(NotFound()); } else { throw; } } return(CreatedAtAction("GetLocation", new { id = location.ID }, location)); }
public async Task CreatePlaceReport(Report <Place> placeReport) { /*EntityEntry<Report<Place>> newlyAdded = */ await dbContext.PlaceReports.AddAsync(placeReport); await dbContext.SaveChangesAsync(); }
public async Task CreateReviewReport(Report <Review> reviewReport) { await dbContext.ReviewReports.AddAsync(reviewReport); await dbContext.SaveChangesAsync(); }
public async Task CreateUserReport(Report <User> userReport) { EntityEntry <Report <User> > newlyAdded = await dbContext.UserReports.AddAsync(userReport); await dbContext.SaveChangesAsync(); }