In the example for Chapter 8/Projection Strategies/Object Initializers - why are the {} unbalanced?
On my machine (which runs the example just fine) there is a "}" following temp.Dump(); there is no "}" at the end of the class definition for TempProjectionItem. Why is this?
I'm guessing that there is an implicit "{" at the start of the statements and "}" at the end. It just looks odd.
Good question!
This is because that example defines an extension method. Ordinarily, when you define classes in LINQPad, they're nested classes and so can't be static and so can't contain extension methods. This trick lets you create a nonnested class.
I hope to find some way around this in future versions - so you'll be able to define extensions methods without the unmatched brackets.
Joe
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)