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
FieldInfoSource 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
FieldInfoSource field info.
includeDeclaringType
boolWhen set to true, then DeclaringType will be included in the string. false by default.
Returns
- string
String representation of the provided
field
.