62 lines
2.6 KiB
Markdown
62 lines
2.6 KiB
Markdown
# System.Text.Json.Serialization
|
|
|
|
``` diff
|
|
+namespace System.Text.Json.Serialization {
|
|
+ public abstract class JsonAttribute : Attribute {
|
|
+ protected JsonAttribute();
|
|
+ }
|
|
+ public sealed class JsonConstructorAttribute : JsonAttribute {
|
|
+ public JsonConstructorAttribute();
|
|
+ }
|
|
+ public abstract class JsonConverter {
|
|
+ public abstract bool CanConvert(Type typeToConvert);
|
|
+ }
|
|
+ public abstract class JsonConverter<T> : JsonConverter {
|
|
+ protected internal JsonConverter();
|
|
+ public virtual bool HandleNull { get; }
|
|
+ public override bool CanConvert(Type typeToConvert);
|
|
+ public abstract T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options);
|
|
+ public abstract void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options);
|
|
+ }
|
|
+ public class JsonConverterAttribute : JsonAttribute {
|
|
+ protected JsonConverterAttribute();
|
|
+ public JsonConverterAttribute(Type converterType);
|
|
+ public Type ConverterType { get; }
|
|
+ public virtual JsonConverter CreateConverter(Type typeToConvert);
|
|
+ }
|
|
+ public abstract class JsonConverterFactory : JsonConverter {
|
|
+ protected JsonConverterFactory();
|
|
+ public abstract JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options);
|
|
+ }
|
|
+ public sealed class JsonExtensionDataAttribute : JsonAttribute {
|
|
+ public JsonExtensionDataAttribute();
|
|
+ }
|
|
+ public sealed class JsonIgnoreAttribute : JsonAttribute {
|
|
+ public JsonIgnoreAttribute();
|
|
+ public JsonIgnoreCondition Condition { get; set; }
|
|
+ }
|
|
+ public enum JsonIgnoreCondition {
|
|
+ Always = 0,
|
|
+ Never = 2,
|
|
+ WhenNull = 1,
|
|
+ }
|
|
+ public sealed class JsonIncludeAttribute : JsonAttribute {
|
|
+ public JsonIncludeAttribute();
|
|
+ }
|
|
+ public sealed class JsonPropertyNameAttribute : JsonAttribute {
|
|
+ public JsonPropertyNameAttribute(string name);
|
|
+ public string Name { get; }
|
|
+ }
|
|
+ public sealed class JsonStringEnumConverter : JsonConverterFactory {
|
|
+ public JsonStringEnumConverter();
|
|
+ public JsonStringEnumConverter(JsonNamingPolicy namingPolicy = null, bool allowIntegerValues = true);
|
|
+ public override bool CanConvert(Type typeToConvert);
|
|
+ public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options);
|
|
+ }
|
|
+ public sealed class ReferenceHandling {
|
|
+ public static ReferenceHandling Default { get; }
|
|
+ public static ReferenceHandling Preserve { get; }
|
|
+ }
|
|
+}
|
|
```
|
|
|