80 lines
2.2 KiB
C#
80 lines
2.2 KiB
C#
// Documents.cs
|
|
namespace EPI2CrewbrainFile
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
|
|
public partial class Documents
|
|
{
|
|
[JsonProperty("ID")]
|
|
public long Id { get; set; }
|
|
|
|
[JsonProperty("DokumentID")]
|
|
public long DokumentId { get; set; }
|
|
|
|
[JsonProperty("Zugehoerigkeit")]
|
|
public string Zugehoerigkeit { get; set; }
|
|
|
|
[JsonProperty("ZugehoerigkeitID")]
|
|
public long ZugehoerigkeitId { get; set; }
|
|
|
|
[JsonProperty("Sichtbarkeit")]
|
|
public long Sichtbarkeit { get; set; }
|
|
|
|
[JsonProperty("AngelegtID")]
|
|
public long AngelegtId { get; set; }
|
|
|
|
[JsonProperty("AngelegtDatum")]
|
|
public DateTimeOffset AngelegtDatum { get; set; }
|
|
|
|
[JsonProperty("GeaendertID")]
|
|
public long GeaendertId { get; set; }
|
|
|
|
[JsonProperty("GeaendertDatum")]
|
|
public DateTimeOffset GeaendertDatum { get; set; }
|
|
|
|
[JsonProperty("Geloescht")]
|
|
public object Geloescht { get; set; }
|
|
|
|
[JsonProperty("Dateiname")]
|
|
public string Dateiname { get; set; }
|
|
|
|
[JsonProperty("Dateiendung")]
|
|
public string Dateiendung { get; set; }
|
|
|
|
[JsonProperty("Groesse")]
|
|
public long Groesse { get; set; }
|
|
|
|
[JsonProperty("FremdKundenID")]
|
|
public long FremdKundenId { get; set; }
|
|
|
|
[JsonProperty("URL")]
|
|
public Uri Url { get; set; }
|
|
|
|
public static List<Documents> FromJson(string json) =>
|
|
JsonConvert.DeserializeObject<List<Documents>>(json, Converter.Settings);
|
|
}
|
|
|
|
public static class Serialize
|
|
{
|
|
public static string ToJson(this List<Documents> self) =>
|
|
JsonConvert.SerializeObject(self, Converter.Settings);
|
|
}
|
|
|
|
internal static class Converter
|
|
{
|
|
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
|
{
|
|
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
|
DateParseHandling = DateParseHandling.None,
|
|
Converters =
|
|
{
|
|
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
|
|
},
|
|
};
|
|
}
|
|
}
|