public static void Write(JsonWriter writer, Result item) { if (item == null) { writer.WriteNull(); } else { writer.WriteStartObject(); JsonToString.Write(writer, "ruleId", item.RuleId, default); JsonToRule.Write(writer, "rule", item.Rule); JsonToString.Write(writer, "guid", item.Guid, default); JsonToBool.Write(writer, "isActive", item.IsActive, default); JsonToString.Write(writer, "message", item.Message, default); JsonToInt.Write(writer, "startLine", item.StartLine, default); JsonToDateTime.Write(writer, "whenDetectedUtc", item.WhenDetectedUtc, default); JsonToEnum <BaselineState> .Write(writer, "baselineState", item.BaselineState, default(BaselineState)); JsonToIDictionary <String, String> .Write(writer, "properties", item.Properties, JsonToString.Write); JsonToIList <int> .Write(writer, "tags", item.Tags, JsonToInt.Write); writer.WriteEndObject(); } }
public static void Write(JsonWriter writer, Person item) { if (item == null) { writer.WriteNull(); } else { writer.WriteStartObject(); JsonToDateTime.Write(writer, "birthdate", item.Birthdate, default); JsonToString.Write(writer, "name", item.Name, default); writer.WriteEndObject(); } }
public static void Write(JsonWriter writer, File item) { if (item == null) { writer.WriteNull(); } else { writer.WriteStartObject(); JsonToInt.Write(writer, "parentFolderIndex", item.ParentFolderIndex, default); JsonToString.Write(writer, "name", item.Name, default); JsonToDateTime.Write(writer, "lastModifiedUtc", item.LastModifiedUtc, default); JsonToDateTime.Write(writer, "createdUtc", item.CreatedUtc, default); JsonToEnum <System.IO.FileAttributes> .Write(writer, "attributes", item.Attributes, default); JsonToLong.Write(writer, "length", item.Length, default); writer.WriteEndObject(); } }