예제 #1
0
 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;
     }
 }
예제 #2
0
 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);
         }
     }
 }