Пример #1
0
        public async Task DeleteIfExists(string email)
        {
            if (string.IsNullOrWhiteSpace(email))
            {
                throw new ArgumentException($"Parameter '{nameof(email)}' must have a value");
            }

            var user = await _databaseClient.GetDocumentByExpression <UserModel>(_databaseName, _userCollectionName, u => u.Email == email);

            if (user != null)
            {
                await _databaseClient.DeleteDocument(_databaseName, _userCollectionName, user.Id);
            }
        }