Table of Contents

Struct PropertyDataModel

Namespace
PolyType.Roslyn
Assembly
PolyType.Roslyn.dll

Represents the data model for either an instance property or an instance field.

public readonly struct PropertyDataModel
Inherited Members

Constructors

PropertyDataModel(IFieldSymbol)

Creates a new instance of PropertyDataModel from a field symbol.

public PropertyDataModel(IFieldSymbol field)

Parameters

field IFieldSymbol

PropertyDataModel(IPropertySymbol)

Creates a new instance of PropertyDataModel from a property symbol.

public PropertyDataModel(IPropertySymbol property)

Parameters

property IPropertySymbol

Properties

BaseSymbol

For virtual properties, returns the symbol corresponding to the base property.

public ISymbol? BaseSymbol { get; }

Property Value

ISymbol

DeclaringType

The declaring type of the property or field.

public INamedTypeSymbol DeclaringType { get; }

Property Value

INamedTypeSymbol

IncludeGetter

Whether the getter is part of the data model.

public required bool IncludeGetter { get; init; }

Property Value

bool

IncludeSetter

Whether the setter is part of the data model.

public required bool IncludeSetter { get; init; }

Property Value

bool

IsAmbiguous

Gets a value indicating whether the member is ambiguous due to diamond inheritance.

public bool IsAmbiguous { get; init; }

Property Value

bool

IsField

Whether this model represents a field.

public bool IsField { get; }

Property Value

bool

IsGetterAccessible

Whether we can access the property getter.

public required bool IsGetterAccessible { get; init; }

Property Value

bool

IsGetterNonNullable

Whether the getter method output is non-nullable.

public required bool IsGetterNonNullable { get; init; }

Property Value

bool

IsInitOnly

Whether the property is init-only.

public bool IsInitOnly { get; }

Property Value

bool

IsRequiredByPolicy

Whether the property or field is considered required by policy (e.g. syntax, overridden by attribute).

public bool? IsRequiredByPolicy { get; init; }

Property Value

bool?

IsRequiredBySyntax

Whether the property or field is declared with the required modifier.

public bool IsRequiredBySyntax { get; init; }

Property Value

bool

IsSetterAccessible

Whether we can access the property setter.

public required bool IsSetterAccessible { get; init; }

Property Value

bool

IsSetterNonNullable

Whether the setter method requires a non-nullable input.

public required bool IsSetterNonNullable { get; init; }

Property Value

bool

LogicalName

A logical name overwriting the underlying name.

public string? LogicalName { get; init; }

Property Value

string

Name

The declared name of the property or field.

public string Name { get; }

Property Value

string

Order

The declared order of the property or field.

public int Order { get; init; }

Property Value

int

PropertySymbol

Either an IPropertySymbol or an IFieldSymbol.

public ISymbol PropertySymbol { get; }

Property Value

ISymbol

PropertyType

The type exposed by this property.

public ITypeSymbol PropertyType { get; }

Property Value

ITypeSymbol