Re: question on anonymous type
- From: "Tim Jarvis" <tim@xxxxxxxxxxxxx>
- Date: Thu, 05 Jun 2008 20:16:50 -0700
Arne Vajhøj wrote:
At the moment, yes. I think things will change as C# 3 becomes more
widely known.
I doubt it.
C# 3 will become widely known.
But most C# developers will have learned C# in earlier versions
and many of them will also use other languages from let us call
it "the C syntax family".
I think though that var is a special case because in some circumstances
its the only effective way to reference a type, anonymous types gained
from projection out of a linq query for example.
var report = from line in SomeEnumeration
select new
{
Value = line.SomeValue,
AnotherValue = line.AnotherValue
}
foreach (var reportline in report)
{
//...
}
I this will become common enough for var to be considered "normal" C#
syntax.
Cheers Tim.
--
.
- Follow-Ups:
- Re: question on anonymous type
- From: Arne Vajhøj
- Re: question on anonymous type
- References:
- question on anonymous type
- From: timor . super
- Re: question on anonymous type
- From: Arne Vajhøj
- Re: question on anonymous type
- From: Jon Skeet [C# MVP]
- Re: question on anonymous type
- From: Arne Vajhøj
- question on anonymous type
- Prev by Date: Re: question on anonymous type
- Next by Date: RE: How to alias 2 classes in c#
- Previous by thread: Re: question on anonymous type
- Next by thread: Re: question on anonymous type
- Index(es):