/// <summary> /// allows a user to delete one of their saved trips by using it's answerCode /// </summary> /// <param name="userid"></param> /// <param name="answerCode"></param> /// <returns></returns> public async Task DeleteTrip(int userid, string answerCode) { _context.Remove(await(GetTrip(userid, answerCode))); await _context.SaveChangesAsync(); }
/// <summary> /// Takes in a user ID, queries the database for the ID and removes that ID from the database. /// </summary> /// <param name="userid">Takes in the user ID as an integer.</param> public async Task DeleteUser(int userid) { _context.Remove(await GetUser(userid)); await _context.SaveChangesAsync(); }