예제 #1
0
        protected JObject ToJSON(Boolean Embedded,
                                 Boolean IncludeLastChange,
                                 Boolean IncludeCryptoHash,
                                 Func <JObject, JObject> CustomAEntitySerializer = null,
                                 params JProperty[]      JSONProperties)
        {
            var JSON = JSONObject.Create(

                new JProperty[] {
                new JProperty("@id", Id.ToString()),

                Embedded
                                   ? null
                                   : new JProperty("@context", JSONLDContext.ToString()),

                CustomData != default
                                   ? new JProperty("customData", CustomData)
                                   : null,

                DataSource.IsNotNullOrEmpty()
                                   ? new JProperty("dataSource", DataSource)
                                   : null,

                IncludeLastChange
                                   ? new JProperty("lastChange", LastChange.ToIso8601())
                                   : null,

                IncludeCryptoHash
                                   ? new JProperty("hashValue", HashValue)
                                   : null
            }.
예제 #2
0
        /// <summary>
        /// Create a new abstract entity.
        /// </summary>
        /// <param name="Id">The unique identification of this entity.</param>
        /// <param name="JSONLDContext">The JSON-LD context of this entity.</param>
        /// <param name="CustomData">Custom data stored within this entity.</param>
        /// <param name="DataSource">The source of this information, e.g. an automatic importer.</param>
        /// <param name="LastChange">The timestamp of the last changes within this entity. Can e.g. be used as a HTTP ETag.</param>
        protected AEntity(TId Id,
                          JSONLDContext JSONLDContext,
                          JObject CustomData  = default,
                          String DataSource   = default,
                          DateTime?LastChange = default)

            : base(Id,
                   JSONLDContext,
                   CustomData,
                   DataSource,
                   LastChange)

        {
        }