Re: question on anonymous type

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Jun 3, 6:03 am, timor.su...@xxxxxxxxx wrote:
Hi all,

I have a question on anonymous type

I can write :
    using (StreamWriter writer = new StreamWriter(...))

and I can write this too :
    using (var writer = new StreamWriter(...))

What is the best ? Which option should I choose ?
The first seems to be more readable ...

Thanks in advance for your answer

Hi,

I would go for the first one, in this case using an anonymous type is
unnecesary, somewhere I read a post that lamented that MS allowed such
a construction.
BTW, the above is not an anonymous type expression
.