I dont know how to retrieve first Item from this collection :
IGrouping<string, Plantilla> groupCast = group as System.Linq.IGrouping<string, Plantilla>;
I also tryed :
IGrouping<string, Plantilla> firstFromGroup = groupCast.FirstOrDefault();
but not works cause and explicit conversion already exist
Why not just use var
?
var firstFromGroup = group.First();
As for the reason you're getting an error, I'm guessing either the Key or Element is different than what you think they are. Take a look at the rest of the error message to see what types the compiler is complaining about. Note that if there is an anonymous type involved, the only way to get it is using var
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With