[ProtoContract] class A { [ProtoMember(1)] public B bbb { get;set; //getter & setter is here } } [ProtoContract] public class B : IData { ///???0 [ProtoMember(1)] public IEnumerable <IData> subData { get;set; //getter & setter is here //the setter puts some data inn structure that in fact contains List<T> plus some simple int's } ///???? public interface IData: Iface1 { ///???? IEnumerable<Iface3> data2 {get;} ///???? IEnumerable<IData> subdata{get;} }
When I try to serialize a class object, I get an error: "The serial identifier is not defined for the type: System.Collections.Generic.IEnumerable`1 [IData, namespaceMy, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = zero]
Question: how could I serialize and deserialize this IEnumerable?
Changing IEnumerable to List <> was a bad idea ((for a lot of code in this program it expects IEnumerable and a horde of errors. As a possible duplicate, type T was not an interface in this case
source share