Table of Contents

Class FieldInfoExtensions

Namespace
LfrlAnvil.Extensions
Assembly
LfrlAnvil.Core.dll

Contains FieldInfo extension methods.

public static class FieldInfoExtensions
Inheritance
FieldInfoExtensions
Inherited Members

Methods

GetBackedProperty(FieldInfo)

Attempts to get the auto-property backed by the provided compiler-generated source field.

[Pure]
public static PropertyInfo? GetBackedProperty(this FieldInfo source)

Parameters

source FieldInfo

Source field.

Returns

PropertyInfo

PropertyInfo instance backed by the source field, if it exists, otherwise null.

Remarks

Backing field names are of the form <{PROPERTY_NAME}>k__BackingField.

GetDebugString(FieldInfo, bool)

Creates a string representation of the provided field.

[Pure]
public static string GetDebugString(this FieldInfo field, bool includeDeclaringType = false)

Parameters

field FieldInfo

Source field info.

includeDeclaringType bool

When set to true, then DeclaringType will be included in the string. false by default.

Returns

string

String representation of the provided field.