public async Task <IActionResult> DeleteEvent(int id) { var myEvent = await context.Events.FindAsync(id); if (myEvent == null) { return(NotFound()); } context.Remove(myEvent); await context.SaveChangesAsync(); return(Ok(id)); }
public async Task <IActionResult> DeleteRequest(int id) { var request = await context.Requests.FindAsync(id); if (request == null) { return(NotFound()); } context.Remove(request); await context.SaveChangesAsync(); return(Ok(id)); }
public async Task <IActionResult> DeleteUser(int id) { var user = await context.Users.FindAsync(id); if (user == null) { return(NotFound()); } context.Remove(user); await context.SaveChangesAsync(); return(Ok(id)); }
public async Task <IActionResult> DeletePreference(int id) { var preference = await context.Preferences.FindAsync(id); if (preference == null) { return(NotFound()); } context.Remove(preference); await context.SaveChangesAsync(); return(Ok(id)); }