Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Quick question; I've recently upgraded to VS2010, and got the new version of ReSharper.

Now, when ReSharper is giving me autocomplete options for a variable, it give me the option of <variableName>:

What does the : stand for?

For example; I have this:

var productIds = new List<int>(inventoryItemsToProcess.Keys);

And when I start typing out a line like this:

var lastOrderDates = GetProductLastOrderDates(pro

It gives me the option for productIds as well as productIds:

What's the difference between the two?

question from:https://stackoverflow.com/questions/3283781/c-sharp-syntax-colon-after-a-variable-name

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
402 views
Welcome To Ask or Share your Answers For Others

1 Answer

The second is for C# 4.0 named arguments. And here's a link on MSDN.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...