Microsoft
Software
Hardware
Network
Question : c# linq - "NOT IN"
hi there,
i am using c# 3.5.
I am building up an IQueryable linq query - which i will execute once i have added all of the clauses.
Essentially, i have a list of int's and i want to add a clause to my query - that says
"give me all customers whose id is NOT IN my list of previously selected customer id's"
i.e give me NEW customers...
here is my code sofar:
public IQueryable<Customer> CreateQuery(IList<int> previouslySelectedCustomer
Ids, IQueryable<Customer> query)
{
if (query == null)
{
throw new ArgumentNullException("que
ry");
}
return query.Join(previouslySelec
tedCustome
rIds, c => c.Customer.Id, us => psc, (c, psc) => c);
}
unfortunately - this joins to the previously selected customers - rather than excluding them!
can anyone help
than ks
Answer : c# linq - "NOT IN"
Hi MrKevorkian;
Try the return statement like this:
return query.Where( c => !previouslySelectedCustome
rIds.Conta
ins(c.Id))
Fernando
Random Solutions
A tiff file that works well with XP but not windows 7 "paint". Can some one give me some ideas?
Why is my border not wrapping around all of my content in firefox??
Visual Basic ListView / SQL
How can I get an email to release its hold on an attachment after sending?
How to open new pdf window using struts ?
Unable to retrieve rootDSE of ldap server
Configuring logging in named.conf
Advice on Gbic switches for major network installation
Group Policy not applying to XP Machines
Read all data from a datagridview and copy it to a public array or something like that...