3 posts tagged object initializers
Subscribe-
Object initializers vs. Constructors
http://skeevs.com/ post/ 34094168Object initializers vs. Constructors Do the introduction of object initializers in VS 2008 mean the end of constructors? Dim p As New Person With {.Name = “James Brown”, .Age = 60} Well, no. Constructors provide means for the class to implicate it’s required values/information during
-
Generating object initializers with ReSharper
http://blogs.jetbrains.com/ dotnet/ 2008/ 04/ generating-object-initializers-wit…ReSharper provides both a quick-fix and a context action to transform assignment statements into C# object initializers, and both are called “Use object initializer”. So what’s the difference between them?
-
Collection Initializers
http://haacked.com/ archive/ 2008/ 01/ 06/ collection-initializers.aspxFile this in my learn something new every day bucket. I received an email from Steve Maine after he read a blog post in which I discuss the anonymous object as dictionary trick that Eilon came up with. He mentioned that there is an object initializer syntax for collections and dictionaries.