Method IsInitOnly
IsInitOnly(PropertyInfo)
Determines whether the specified PropertyInfo represents an init-only property.
Declaration
public static bool IsInitOnly(this PropertyInfo propertyInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| PropertyInfo | propertyInfo | The property to inspect. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Init-only properties are marked with the System.Runtime.CompilerServices.IsExternalInit modifier
in their metadata, which is a feature introduced in C# 9 for immutable objects.