public IEnumerable <File> GetUserSharedFiles(Guid id) { try { var shares = _sharesRepository.GetUserShares(id); return(shares.Select(share => _filesRepository.GetInfo(share.FileId))); } catch (Exception ex) { Log.Logger.ServiceLog.Error(ex.Message); throw; } }
public void Clean() { if (TestUser != null) { foreach (var share in _sharesRepository.GetUserShares(TestUser.UserId)) { _sharesRepository.DeleteShare(share.ShareId); } foreach (var file in _filesRepository.GetFilesByUserId(TestUser.UserId)) { _filesRepository.Delete(file.FileId); _usersRepository.DeleteUser(TestUser.UserId); } } }