GeneratedSerializer

Reflection-free member access for one serializable type, emitted by the Turian source generator.

Public Methods

Create

public IdClass Create()

Creates an empty instance.

Returns: IdClass

WriteMembers

public void WriteMembers(Utf8JsonWriter writer, IdClass value, JsonSerializerOptions options)

Writes every serialized member as JSON properties.

Parameters:

  • writer (Utf8JsonWriter): The JSON writer, inside the object.
  • value (IdClass): The instance to write.
  • options (JsonSerializerOptions): The serializer options.

ReadMember

public bool ReadMember(IdClass value, JsonProperty property, JsonSerializerOptions options)

Reads one JSON property into its member.

Parameters:

  • value (IdClass): The instance being read.
  • property (JsonProperty): The JSON property.
  • options (JsonSerializerOptions): The serializer options.

Returns: bool

  • False when no member has that name.

SetMember

public bool SetMember(IdClass value, string member, object? memberValue)

Assigns a member by name.

Parameters:

  • value (IdClass): The instance to write.
  • member (string): The member name.
  • memberValue (object?): The value to assign.

Returns: bool

  • False when no writable member has that name.

MemberType

public Type? MemberType(string member)

The declared type of a member by name, or null.

Parameters:

  • member (string): The member name.

Returns: Type?

  • The member type.