PostSharp 6.4 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Reflection Namespace / Reflection­Extensions Class / Reflection­Extensions Methods / Reflection­Extensions.​Get­Backing­Field Method

ReflectionExtensions.GetBackingField Method

Gets the backing field of a given property.

Namespace:  PostSharp.Reflection
Assembly:  PostSharp (in PostSharp.dll) Version: 6.4.11.0 (6.4.11.0)
Syntax
C#
public static FieldInfo GetBackingField(
	this PropertyInfo propertyInfo
)

Parameters

propertyInfo
Type: System.Reflection.PropertyInfo
A property.

Return Value

Type: FieldInfo
The FieldInfo representing the backing field of propertyInfo, or null if propertyInfo is not an automatic property.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type PropertyInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also