Пример #1
0
        public async Task DeleteUser(string id)
        {
            var user = await _userManager.FindByIdAsync(id);

            if (user == null)
            {
                throw new ObjectNotFoundException($"user with id {id} not found");
            }

            var path = Path.Combine(_fileOptions.DirectoryPath, id);

            _imageProvider.DeleteDirectory(path);

            await _userManager.DeleteAsync(user);
        }