0

I have the following search query:

IQueryable<File> files = GetFiles(f => f.Clients.Any(fc => fc.Contacts.Any(c => c.Companies.Any(x => x.Name.Contains(searchText)))));

Unfortunately the search for Companies.Name will never work because the Name is encrypted.

So I have the following list of decrypted Companies. It's a Stored Procedure and it uses SQL CLR to decrypt the Name field:

List<Company> companies = GetSearchCompanies(searchText).Query.ToList();

This list is working fine, it returns a list of companies based on the searchText.

My question is whether I can replace the original files list of companies in order to be able to search against decrypted Company names as well as the other searches against Contacts, Clients, etc.

Any help would be appreciated and thanks in advance.

4

1 回答 1

1

怎么样:

var newFiles = from f in files
               join c in companies on f.CompanyId equals c.CompanyId
               select new File
               {
                   prop1 = f.prop1,
                   //Assign all your other properties
                   Company = c
               };
于 2013-05-23T02:30:47.930 回答