RealtimeSessionOptions.RawRepresentationFactory Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a callback responsible for creating the raw representation of the session options from an underlying implementation.
public:
property Func<System::Object ^> ^ RawRepresentationFactory { Func<System::Object ^> ^ get(); void set(Func<System::Object ^> ^ value); };
[System.Text.Json.Serialization.JsonIgnore]
public Func<object?>? RawRepresentationFactory { get; init; }
[<System.Text.Json.Serialization.JsonIgnore>]
member this.RawRepresentationFactory : Func<obj> with get, set
Public Property RawRepresentationFactory As Func(Of Object)
Property Value
- Attributes
Remarks
The underlying IRealtimeClientSession implementation might have its own representation of options. When a SessionUpdateRealtimeClientMessage is sent with a RealtimeSessionOptions, that implementation might convert the provided options into its own representation in order to use it while performing the operation. For situations where a consumer knows which concrete IRealtimeClientSession is being used and how it represents options, a new instance of that implementation-specific options type can be returned by this callback for the IRealtimeClientSession implementation to use, instead of creating a new instance. Such implementations might mutate the supplied options instance further based on other settings supplied on this RealtimeSessionOptions instance or from other inputs. Therefore, it is strongly recommended to not return shared instances and instead make the callback return a new instance on each call. This is typically used to set an implementation-specific setting that isn't otherwise exposed from the strongly typed properties on RealtimeSessionOptions.
Unlike similar factories on other options types, this callback does not receive the session instance as a parameter because some providers need to evaluate it before the session is created (e.g., to produce connection configuration).