Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting properties in Generic list
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 5.0
OS:
Windows 7
Network:
SAMBA Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01610922
Message ID:
01610956
Views:
23
>Nice one Viv I'll give it a go

Two other options (which actually bring nothing to the table - but I had to try them):
list.ForEach(delegate(Info i) { if (i.Postcode.StartsWith("HR"))  i.SomeProperty = true;  });
Or, more reusable:
 private static void MarkPostCode(Info i, string s)
        {
            if (i.Postcode.StartsWith(s)) i.SomeProperty = true; ;
        }
       // used with:
       list.ForEach(i=>  MarkPostCode(i,"HR"));
Previous
Reply
Map
View

Click here to load this message in the networking platform