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
The provider used for property-level attribute resolution.
ICustomAttributeProvider? AttributeProvider { get; }
Property Value
DeclaringType
The shape of the declaring type.
IObjectTypeShape DeclaringType { get; }
Property Value
HasGetter
Specifies whether the property has an accessible getter.
bool HasGetter { get; }
Property Value
HasSetter
Specifies whether the property has an accessible setter.
bool HasSetter { get; }
Property Value
IsField
Specifies whether the shape represents a .NET field.
bool IsField { get; }
Property Value
IsGetterNonNullable
Specifies 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
Specifies whether the property getter is declared public.
bool IsGetterPublic { get; }
Property Value
IsSetterNonNullable
Specifies 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
Specifies whether the property setter is declared public.
bool IsSetterPublic { get; }
Property Value
Name
The name of the property.
string Name { get; }
Property Value
PropertyType
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.