Beispiel #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
            }.
Beispiel #2
0
        public void UpdateCount(int count)
        {
            if (Count == count)
            {
                return;
            }

            LastUpdated           = DateTime.Now;
            LastChange            = count - Count;
            LastChangeDescription = LastChange.ToString();
            if (!LastChangeDescription.StartsWith("-"))
            {
                LastChangeDescription = $"+{LastChangeDescription}";
            }
            this.Count = count;
        }
Beispiel #3
0
 public override string ToString()
 {
     return(string.Format("\nID:{0}\nCategory:{10}\nTitle:{1}\nPrice:{2}\nPostDate:{3}\nLastChange:{4}\nLocation:{5}\nPhoneSaler:{7}\nQuality:{8}\nAddress:{9}\nContent:{6}",
                          ID.ToString()
                          , Title.ToString()
                          , Price.ToString()
                          , PostDate.ToString()
                          , LastChange.ToString()
                          , Location
                          , Content
                          , PhoneSaler
                          , Quality
                          , Address
                          , Category
                          ));
 }
Beispiel #4
0
 public override string ToString()
 {
     return(string.Format("ID:{0}\nTitle:{1}\nPrice:{2}\nPostDate:{3}\nLastChange:{4}",
                          ID.ToString(), Title.ToString(), Price.ToString(), PostDate.ToString(), LastChange.ToString()));
 }