Loading...
 
JoiWiki » Developer » .Net » .Net Snippets » Collection Manipulation Shotcuts Collection Manipulation Shotcuts

Collection Manipulation Shotcuts

 

 Collections have come a long way since arrays (though arrays have their place) and with things like lambda expressions and linq you can do a lot with a simple list. I'm forever forgetting syntax and things like that so here's a quick cheat sheet that I'll add to as time goes on:

 

Lists
Humble yet effective, I use lists all the time because of what they can offer as far as functionality and coding syntax is concerned, here are a few tricks:

Get highest date in a list of custom objects:

DateTime maxJoin = PrevJoiners.OrderByDescending(o => o.ProcessedDate).First().ProcessedDate;

 

 

 

 

Created by JBaker. Last Modification: Wednesday February 5, 2020 19:42:20 GMT by JBaker.

Developer