protobuf-csharp-port icon indicating copy to clipboard operation
protobuf-csharp-port copied to clipboard

Expose repeated extension field as IList

Open GoogleCodeExporter opened this issue 10 years ago • 2 comments
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

GoogleCodeExporter avatar Apr 07 '15 15:04 GoogleCodeExporter

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

GoogleCodeExporter avatar Apr 07 '15 15:04 GoogleCodeExporter

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

GoogleCodeExporter avatar Apr 07 '15 15:04 GoogleCodeExporter