Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting properties in Generic list
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 5.0
OS:
Windows 7
Network:
SAMBA Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01610922
Message ID:
01610925
Vues:
35
>Hi All, is it possible in a "Linq type way" to set properties of class instances which are in a IList ? , for example I have a list of names and addresses in a list and if there are some that share a certain residential area code (e.g. UK ) I would like to set a property in the instances, hope this makes sense.

Closest you can get is probably something like:
foreach(Info i in list.Where(x=>x.Postcode.StartsWith="HR"))
            {
                i.SomeProperty = true;
            }
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform