Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacing IList<> in protobuf-net v3 update?

In the protobuf-net v3 release notes, one of the breaking changes is: non-generic list-like APIs like IList or ICollection are no longer supported; there is a new API for processing custom collection types.

I've been looking through the repo, but haven't been able to figure out the details. Would someone be able to provide an example on how to migrate this data contract to v3?

Here is an example:

[DataContract]
public class Data
{
   [DataMember(Order = 1)] 
   public IList<DataEntry> DataEntries
}

[DataContract]
public class DataEntry
{
   [DataMember(Order = 1)] 
   public string Name; 
}
like image 428
Angela Yang Avatar asked Jan 26 '26 23:01

Angela Yang


1 Answers

No change is necessary. You are using IList<T>, which is the generic API. The thing that isn't supported is using the old non-generic IList (with no <T>)

like image 62
Marc Gravell Avatar answered Jan 28 '26 13:01

Marc Gravell