Instantiation syntax - our own Classes etc.
Posted: Thu Oct 27, 2016 11:10 am
Hi Robert, Team and guys,
I am trying to provide in my LINQ eNotes a better way to 'Select' than to use an anonymous type, when it then causes issues afterwards - to access elements and their properties.
I have followed Nick's advice and made myself a working 'concrete' class call "EightP2S".
The attached image shows the working code but also a couple of commented and failed code attempts by me, to find some alternative syntax for specifying the property values at the point of instantiation - all in the 'select' clause.
I would like a much tighter version of line 82, and one where the string values for City and Email could not get mixed up (swapped around) just because I got my positioning (placement) wrong in my code. The compiler would not complain at my mistake!
Please can you help and make some suggestions etc.,
Cheers,
Phil. Cheers,
Phil.
I am trying to provide in my LINQ eNotes a better way to 'Select' than to use an anonymous type, when it then causes issues afterwards - to access elements and their properties.
I have followed Nick's advice and made myself a working 'concrete' class call "EightP2S".
The attached image shows the working code but also a couple of commented and failed code attempts by me, to find some alternative syntax for specifying the property values at the point of instantiation - all in the 'select' clause.
I would like a much tighter version of line 82, and one where the string values for City and Email could not get mixed up (swapped around) just because I got my positioning (placement) wrong in my code. The compiler would not complain at my mistake!
Please can you help and make some suggestions etc.,
Cheers,
Phil. Cheers,
Phil.