Table of Contents

Class ReflectionTypeShapeProviderOptions

Namespace
PolyType.ReflectionProvider
Assembly
PolyType.dll

Exposes configuration options for the reflection-based type shape provider.

public sealed record ReflectionTypeShapeProviderOptions : IEquatable<ReflectionTypeShapeProviderOptions>
Inheritance
ReflectionTypeShapeProviderOptions
Implements
Inherited Members

Properties

Default

Gets the default configuration options.

public static ReflectionTypeShapeProviderOptions Default { get; }

Property Value

ReflectionTypeShapeProviderOptions

TypeShapeExtensionAssemblies

Gets the list of assemblies to scan for TypeShapeExtensionAttribute attributes.

public IReadOnlyList<Assembly> TypeShapeExtensionAssemblies { get; init; }

Property Value

IReadOnlyList<Assembly>

Remarks

The content of this list will typically be made up of the calling assembly, and from GetReferencedAssemblies() invoked on the calling assembly.

Conflicts between TypeShapeExtensionAttribute attributes are resolved by taking the first of the conficting values. It is therefore advisable to order this list so that the calling assembly appears first in the list. The caller is then in a position to set all policies and resolve conflicts between other assemblies.

UseReflectionEmit

Gets a value indicating whether System.Reflection.Emit should be used when generating member accessors.

public bool UseReflectionEmit { get; init; }

Property Value

bool

Remarks

Defaults to true if the runtime supports dynamic code generation.

Methods

Equals(ReflectionTypeShapeProviderOptions?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ReflectionTypeShapeProviderOptions? other)

Parameters

other ReflectionTypeShapeProviderOptions

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.