public async Task <IActionResult> PutUserPlaceSubscription(int id, UserPlaceSubscription userPlaceSubscription) { if (id != userPlaceSubscription.Id) { return(BadRequest()); } _context.Entry(userPlaceSubscription).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserPlaceSubscriptionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <UserPlaceSubscription> > PostUserPlaceSubscription(UserPlaceSubscription userPlaceSubscription) { _context.UserPlaceSubscriptions.Add(userPlaceSubscription); await _context.SaveChangesAsync(); return(CreatedAtAction("GetUserPlaceSubscription", new { id = userPlaceSubscription.Id }, userPlaceSubscription)); }