ここでは正常に動作します(下記参照)。私は喜んでお手伝いしますが、私が見ることができる再現可能な例を追加したいかもしれません。
using System.Collections.Generic;
using System.Linq;
using ProtoBuf;
[ProtoContract]
class Study
{
private readonly List<ClinicalFinding> findings
= new List<ClinicalFinding>();
[ProtoMember(1)]
public List<ClinicalFinding> Findings { get { return findings; } }
}
[ProtoContract]
class ClinicalFinding
{
private readonly List<ScreenShot> screenShots = new List<ScreenShot>();
[ProtoMember(1)]
public List<ScreenShot> ScreenShots { get { return screenShots; } }
}
[ProtoContract]
class ScreenShot
{
[ProtoMember(1)]
public byte[] Blob { get; set; }
}
static class Program
{
static void Main()
{
var study = new Study {
Findings = {
new ClinicalFinding {
ScreenShots = {
new ScreenShot {Blob = new byte[] {0x01, 0x02}},
new ScreenShot {Blob = new byte[] {0x03, 0x04, 0x05}},
}
},
new ClinicalFinding {
ScreenShots = {
new ScreenShot {Blob = new byte[] {0x06, 0x07}},
}
}
}
};
// the following does a serialize/deserialize
var clone = Serializer.DeepClone(study);
int sum = clone.Findings.SelectMany(x => x.ScreenShots)
.SelectMany(x => x.Blob).Sum(x => (int) x); // 28, as expected
}
}
それはあなたのクラス構造 – CharlesB