Blog Home  Home Feed your aggregator (RSS 2.0)  
artiso Blog - Dictionaries in C#3.0 initialisieren
Neues rund um's Thema .Net
 
 Wednesday, October 17, 2007

Vor kurzem hatte ich in einem Post beschrieben, wie man mit C#3.0 Listen effizient initialisieren kann. Das Ganze funktioniert übrigens auch mit Dictionaries. Das siehtr dann einfach so aus:

productVersion.Sales = new Dictionary<int,double>
{
    {2004, 1.5}, {2005, 2.7}, {2006, 3.8}
};
Wednesday, October 17, 2007 9:29:20 AM (Mitteleuropäische Zeit, UTC+01:00)  #    Comments [0]    |  |   | 
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Copyright © 2008 Thomas. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: