Why is the following protobuf-net usage illegal?
By : user3108892
Date : March 29 2020, 07:55 AM
this will help Before about 2 minutes ago, it was illegal because known-types weren't supported against interfaces. Now, that usage is illegal because it can't safely serialize IYObject.X because it has no setter. However, as long as we restrict ourselves to interfaces members that can be sensible serialized, or members on the concrete type, this is now committed. Using either attributes or the type model. See here for the scenarios that are now available (via either code, or the next public drop).
|
Regarding usage of Protobuf-Net in C#
By : arturofha
Date : March 29 2020, 07:55 AM
To fix this issue Works fine here (see below). I'm happy to help, but you might want to add a reproducible example I can look at. code :
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
}
}
|
Is 'OpenNTF Domino API' project ready for production usage?
By : Hannah Pentecost
Date : March 29 2020, 07:55 AM
Hope this helps There are some challenges with using the master branch in XPages. We've done work since April 4th that has made that possible, as well as starting on provisioning the new methods to SSJS. But those features are currently in development branch.
|
Is Xamarin Forms ready for Production usage
By : Swetha Atchuta
Date : March 29 2020, 07:55 AM
|
Is JSR-354 Money API ready for production usage?
By : Francisco
Date : March 29 2020, 07:55 AM
|