why no need to select in vb.net linq
Posted on 2011-10-28
I am in the process of getting to grips with c# having used vb.net for quite some time.
This linq statement in vb:
Dim n = (From cl In GeneralHelper.CostumeGroups Where cl.CostumeGroupID = groupID)
Doesn't need a select at the end to work just fine...
With c# I get an error unless I add the select cl at the end:
dynamic n = (from cl in GeneralHelper.CostumeGroups where cl.CostumeGroupID == groupID select cl);
Why is that?