Re: question on anonymous type

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



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 ?

In this case I see no benefits in either, except "var" is quicker to type.


.