Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ValidationSchema.cs
1using System;
2using System.Text;
7
9{
10 [CollectionName("ValidationSchemas")]
11 [TypeName(TypeNameSerialization.None)]
12 [ArchivingTime]
13 [Index("Namespace", "HashBase64")]
14 [Index("Namespace", "Created")]
15 public class ValidationSchema
16 {
17 private string objectId = null;
19 private string hashBase64 = string.Empty;
20 private string contentType = string.Empty;
21 private byte[] xmlSchema = null;
22 private HashFunction function = HashFunction.SHA256;
23 private DateTime created = DateTime.MinValue;
24
28 [ObjectId]
29 public string ObjectId
30 {
31 get => this.objectId;
32 set => this.objectId = value;
33 }
34
39 {
40 get => this.ns;
41 set => this.ns = value;
42 }
43
47 public string HashBase64
48 {
49 get => this.hashBase64;
50 set => this.hashBase64 = value;
51 }
52
56 [DefaultValue(HashFunction.SHA256)]
58 {
59 get => this.function;
60 set => this.function = value;
61 }
62
66 [DefaultValueNull]
67 public byte[] XmlSchema
68 {
69 get => this.xmlSchema;
70 set => this.xmlSchema = value;
71 }
72
76 [DefaultValueStringEmpty]
77 public string ContentType
78 {
79 get => this.contentType;
80 set => this.contentType = value;
81 }
82
86 public DateTime Created
87 {
88 get => this.created;
89 set => this.created = value;
90 }
91
95 public string Xml
96 {
97 get
98 {
99 Encoding Encoding;
100
101 if (string.IsNullOrEmpty(this.contentType))
102 Encoding = null;
103 else
104 {
105 HttpFieldContentType Header = new HttpFieldContentType("Content-Type", this.contentType);
106 Encoding = Header.Encoding;
107 }
108
109 return (Encoding ?? Encoding.UTF8).GetString(this.xmlSchema);
110 }
111 }
112
113 }
114}
Content-Type HTTP Field header. (RFC 2616, §14.17)
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
TypeNameSerialization
How the type name should be serialized.
HashFunction
Hash method enumeration.
Definition: Hashes.cs:28