protobuf-csharp-port
protobuf-csharp-port copied to clipboard
Expose repeated extension field as IList
trafficstars
To iterate over items of a repeated extensions, one needs to do:
for (int i = 0; i < msg.GetExtensionCount(ExtId); i++)
{
var ext = msg.GetExtension(ExtId, i);
// use ext.
}
It would be nice if one could write:
foreach (var ext in msg.GetExtensionList(ExtId))
{
// use ext.
}
Original issue reported on code.google.com by [email protected] on 7 Mar 2014 at 4:48
Yes, that makes sense - I think. I'll have to try to get into the mindset of
extensions again, but I'll have a look.
Original comment by jonathan.skeet on 7 Mar 2014 at 8:58
Reviewed today - I think this is still something to look at, although I doubt
it'll make it in the 2.x line.
Original comment by jonathan.skeet on 15 Feb 2015 at 5:21