EHRBase/OpenEHR implementation in .Net

@borut.jures

ref C# Libraries for Canonical APIs - #5 by NeoEHR

You can use attributes (in java annotations).

e.g. for Json:

const string JSON = @"{ ""name"": ""xyz-class"" }";

// from json to object
Xyz? xyz = JsonSerializer.Deserialize<Xyz>(JSON);

// from object to json
string jsonString = JsonSerializer.Serialize(xyz);

class Xyz
{ 
    // hint: the suffix Attribute is optional
    [JsonPropertyName("name")] // mapping
    public string Name {get; set;}
}
1 Like