Show / Hide Table of Contents

Class DynamicObjectExtensions

Dynamic extension methods for objects.

Inheritance
System.Object
DynamicObjectExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas
Assembly: Kephas.Core.dll
Syntax
public static class DynamicObjectExtensions

Methods

| Improve this Doc View Source

GetPropertyValue(Object, String)

Dynamically gets the property value.

Declaration
public static object GetPropertyValue(this object obj, string propertyName)
Parameters
Type Name Description
System.Object obj

The object.

System.String propertyName

Name of the property.

Returns
Type Description
System.Object

The property value.

| Improve this Doc View Source

GetRuntimeTypeInfo(Object)

Gets a runtime type information out of the provided instance.

Declaration
public static IRuntimeTypeInfo GetRuntimeTypeInfo(this object obj)
Parameters
Type Name Description
System.Object obj

The object.

Returns
Type Description
IRuntimeTypeInfo

A dynamic type information for the provided object.

| Improve this Doc View Source

SetPropertyValue(Object, String, Object)

Dynamically sets the property value.

Declaration
public static void SetPropertyValue(this object obj, string propertyName, object value)
Parameters
Type Name Description
System.Object obj

The object.

System.String propertyName

Name of the property.

System.Object value

The value.

| Improve this Doc View Source

ToDynamic(Object)

Gets a dynamic object out of the provided instance.

Declaration
public static dynamic ToDynamic(this object obj)
Parameters
Type Name Description
System.Object obj

The object.

Returns
Type Description
System.Object

A dynamic object wrapping the provided object.

| Improve this Doc View Source

ToExpando(Object)

Gets an IExpando object out of the provided instance.

Declaration
public static IExpando ToExpando(this object obj)
Parameters
Type Name Description
System.Object obj

The object.

Returns
Type Description
IExpando

An IExpando wrapping the provided object. If the provided object is an expando, that object is returned.

| Improve this Doc View Source

TryGetPropertyValue(Object, String, out Object)

Dynamically gets the property value.

Declaration
public static bool TryGetPropertyValue(this object obj, string propertyName, out object value)
Parameters
Type Name Description
System.Object obj

The object.

System.String propertyName

Name of the property.

System.Object value

The property value.

Returns
Type Description
System.Boolean

A boolean value indicating whether the property is found.

| Improve this Doc View Source

TrySetPropertyValue(Object, String, Object)

Dynamically sets the property value.

Declaration
public static bool TrySetPropertyValue(this object obj, string propertyName, object value)
Parameters
Type Name Description
System.Object obj

The object.

System.String propertyName

Name of the property.

System.Object value

The value.

Returns
Type Description
System.Boolean

true if the value could be set; otherwise false.

Remarks

If the object passed is null, then false is returned.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX