Instantiation syntax - our own Classes etc.
Posted: Wed Nov 02, 2016 12:50 pm
Hello again Robert,
Sorry, I have had a few days away from LINQ 'stuff' doing some house maintenance - replacing floor boards in a bedroom !! What a task.
However, I do have something positive to post, on the issue of 'in-line' instantiation. Since your last post, I had a play around and a think, and used the current compiler facilities to come up with some better, tidier, and easier to read syntax. The three attached and inserted small images will help explain all. Sorry the 'system' has inserted them in the reverse order to my selection, so checkout '_01' first, then '_02' and '_03'.
By naming the Constructor variables 'in_xxxx' where the X's represent the exact property names, then the code all gets a lot more understandable.
Hope this makes sense, but I would still prefer to use an empty Constructor and then specify (in any order) the property name and the value to be assigned. This way we can effectively have all possible overloads, as zero to 'N' inputs can be provided. Regards to all,
Phil.
Sorry, I have had a few days away from LINQ 'stuff' doing some house maintenance - replacing floor boards in a bedroom !! What a task.
However, I do have something positive to post, on the issue of 'in-line' instantiation. Since your last post, I had a play around and a think, and used the current compiler facilities to come up with some better, tidier, and easier to read syntax. The three attached and inserted small images will help explain all. Sorry the 'system' has inserted them in the reverse order to my selection, so checkout '_01' first, then '_02' and '_03'.
By naming the Constructor variables 'in_xxxx' where the X's represent the exact property names, then the code all gets a lot more understandable.
Hope this makes sense, but I would still prefer to use an empty Constructor and then specify (in any order) the property name and the value to be assigned. This way we can effectively have all possible overloads, as zero to 'N' inputs can be provided. Regards to all,
Phil.