public async Task <bool> EndPartyAsync(PartyGoer host) { try { return(await _partyRepository.DeleteAsync(host)); } catch (Exception ex) { await _logService.LogExceptionAsync(ex, "Error occurred in EndPartyAsync"); return(false); } }
public async Task <bool> EndPartyAsync(PartyGoer host) { try { Party party = await _partyRepository.GetPartyWithHostAsync(host); if (party != null) { return(await _partyRepository.DeleteAsync(party.GetPartyCode())); } return(false); } catch (Exception ex) { await _logService.LogExceptionAsync(ex, "Error occurred in EndPartyAsync"); return(false); } }
public async Task <IActionResult> Delete(ObjectId id) { if (!ModelState.IsValid || id == ObjectId.Empty) { return(BadRequest()); } var delRes = await _partyRepository.DeleteAsync(id); return(Ok(delRes)); }