<PackageReference Include="Google.Protobuf" Version="3.34.2" />

Google.Protobuf.Reflection.IFieldAccessor

public interface IFieldAccessor
Allows fields to be reflectively accessed.

Returns the descriptor associated with this field.

void Clear(IMessage message)

Clears the field in the specified message. (For repeated fields, this clears the list.)

object GetValue(IMessage message)

Fetches the field value. For repeated values, this will be an IList implementation. For map values, this will be an IDictionary implementation.

bool HasValue(IMessage message)

Indicates whether the field in the specified message is set. For proto3 fields that aren't explicitly optional, this throws an InvalidOperationException

void SetValue(IMessage message, object value)

Mutator for single "simple" fields only.