Default(IType, bool)
Creates a TypedConstant representing the default value for the specified type.
When rendered to code, this produces default(T) or default(T)! if hasNullForgivingOperator is true.
Declaration
public static TypedConstant Default(IType type, bool hasNullForgivingOperator = false)Parameters
| Type | Name | Description |
|---|---|---|
| IType | type | The type for which to create a default value. |
| bool | hasNullForgivingOperator | If |
Returns
| Type | Description |
|---|---|
| TypedConstant | A TypedConstant representing |
See Also
Default(Type, bool)
Creates a TypedConstant representing the default value for the specified type.
When rendered to code, this produces default(T) or default(T)! if hasNullForgivingOperator is true.
Declaration
public static TypedConstant Default(Type type, bool hasNullForgivingOperator = false)Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The reflection Type for which to create a default value. |
| bool | hasNullForgivingOperator | If |
Returns
| Type | Description |
|---|---|
| TypedConstant | A TypedConstant representing |