// Delete a WebHook against a User and Id public override async Task <StoreResult> DeleteWebHookAsync(string user, string id) { if (user == null) { throw new ArgumentNullException(nameof(user)); } if (id == null) { throw new ArgumentNullException(nameof(id)); } user = NormalizeKey(user); try { var match = await _webHookRepository.GetOne <Registration>(id, user); if (match == null) { return(StoreResult.NotFound); } return(await _webHookRepository.DeleteOne <Registration>(id, user)); } catch (OptimisticConcurrencyException ocex) { var message = string.Format(CultureInfo.CurrentCulture, Constants.Constants.ConcurrencyError, "Delete", ocex.Message); _logger.Error(message, ocex); return(StoreResult.Conflict); } catch (DbException dbex) { var message = string.Format(CultureInfo.CurrentCulture, Constants.Constants.MongoOperationFailed, "Delete", dbex.Message); _logger.Error(message, dbex); return(StoreResult.OperationError); } catch (Exception ex) { var message = string.Format(CultureInfo.CurrentCulture, Constants.Constants.OperationFailed, "Delete", ex.Message); _logger.Error(message, ex); return(StoreResult.InternalError); } }