A little rusty on the old linco. If I have 2 collections EG Neuquister List and Old Customer List and see if any alias already exists then how can I do this in linq? I'm sure there are many ways to select many bell rings, but forgot how to do it!
What would I do something for each one in Linq?
Any suggestions? Thank you very much
So you are trying to see if someone Are the nicknames of old customers in the list of new customers?
A simple option: join one and see if it's empty:
if (OldCustomerList.Join (NewCustomerList, x = & gt; x.Surname, x = & Gt; x.Surname, (x, y) = & gt; null.) Anyone ()) {...}
(I have used a tap projection because We really do not care about the consequences of joining.)
Another option:
var oldSurnames = new HashSet & lt; String & gt; (OldCustomrList.Select (x = & gt; x.Surname)); If (Newcastle. Anyone (X => Old Name. Insertion (name of x)) {...}
I suspect that you really are in the context of the result The nicknames are in common ... if you can give us more context, we will be able to assist you.
Comments
Post a Comment