Table of Contents

Class ObjectExtension

Namespace
Loehnert.Utility.Extensions
Assembly
Loehnert.Utility.dll

Extensions for objects.

public static class ObjectExtension
Inheritance
ObjectExtension
Inherited Members

Methods

Copy<T>(T)

Copies the given object using a deep clone mechanism.

public static T Copy<T>(this T original)

Parameters

original T

The original.

Returns

T

The cloned object.

Type Parameters

T

Type of the object to clone.

Remarks

GetBackingFieldProperty(FieldInfo, Type, BindingFlags)

Gets the backing field property for a given field.

public static PropertyInfo GetBackingFieldProperty(this FieldInfo fieldInfo, Type typeToReflect, BindingFlags bindingFlags)

Parameters

fieldInfo FieldInfo

The field information.

typeToReflect Type

The type to reflect.

bindingFlags BindingFlags

The binding flags.

Returns

PropertyInfo

The backing field property.

Remarks

IsBackingField(FieldInfo)

Determines whether the given field is a backing field.

public static bool IsBackingField(this FieldInfo fieldInfo)

Parameters

fieldInfo FieldInfo

The field information.

Returns

bool

A value indicating whether the given field is a backing field.

Remarks

IsPrimitive(Type)

Determines whether this instance is primitive.

public static bool IsPrimitive(this Type type)

Parameters

type Type

The type.

Returns

bool

A value indicating whether the type is primitive.

Remarks

Exceptions

ArgumentNullException

Thrown when argument is null.