HV-Lima Peru

Offshore your .NET/SQL Development to Latin America! Languages: en-de-es

How to Linq ListBoxes with Except

There is a cool way to query ListBoxes with Linq.

Imagine there are three ListBoxes:
– A: with all currencies
– B: with selected currencies
– C: with available currencies, like A:.Except(B:)

The content of the visible ListBoxes is like:

For better comprehension I’ve created two sets (that do not materialize):
– Line 253: selectedCurrencies
– Line 255: allCurrencies

The resulting availableCurrencies are built in line 257…

…and materialized at the arrow

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: