Interface IPropertyShape
- Namespace
- PolyType.Abstractions
- Assembly
- PolyType.dll
Provides a strongly typed shape model for a given .NET instance property or field.
public interface IPropertyShape
Properties
AttributeProvider
Gets the provider used for property-level attribute resolution.
ICustomAttributeProvider? AttributeProvider { get; }
Property Value
DeclaringType
Gets the shape of the declaring type.
IObjectTypeShape DeclaringType { get; }
Property Value
HasGetter
Gets a value indicating whether the property has an accessible getter.
bool HasGetter { get; }
Property Value
HasSetter
Gets a value indicating whether the property has an accessible setter.
bool HasSetter { get; }
Property Value
IsField
Gets a value indicating whether the shape represents a .NET field.
bool IsField { get; }
Property Value
IsGetterNonNullable
Gets a value indicating whether the getter returns non-null values.
bool IsGetterNonNullable { get; }
Property Value
Remarks
Returns true if the property type is a non-nullable struct, a non-nullable reference type or the property has been annotated with the NotNullAttribute.
Conversely, it could return false if a non-nullable property has been annotated with MaybeNullAttribute.
IsGetterPublic
Gets a value indicating whether the property getter is declared public.
bool IsGetterPublic { get; }
Property Value
IsSetterNonNullable
Gets a value indicating whether the setter requires non-null values.
bool IsSetterNonNullable { get; }
Property Value
Remarks
Returns true if the property type is a non-nullable struct, a non-nullable reference type or the property has been annotated with the DisallowNullAttribute.
Conversely, it could return false if a non-nullable property has been annotated with AllowNullAttribute.
IsSetterPublic
Gets a value indicating whether the property setter is declared public.
bool IsSetterPublic { get; }
Property Value
Name
Gets the name of the property.
string Name { get; }
Property Value
PropertyType
Gets the shape of the property type.
ITypeShape PropertyType { get; }
Property Value
Methods
Accept(ITypeShapeVisitor, object?)
Accepts an ITypeShapeVisitor for strongly typed traversal.
object? Accept(ITypeShapeVisitor visitor, object? state = null)
Parameters
visitor
ITypeShapeVisitorThe visitor to accept.
state
objectThe state parameter to pass to the underlying visitor.