Class ExpandoExtensions
Extension methods for IExpando.
Inheritance
System.Object
ExpandoExtensions
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.Dynamic
Assembly: Kephas.Core.dll
Syntax
public static class ExpandoExtensions
Methods
| Improve this Doc View SourceGetLaxValue<T>(IIndexable, String, T)
An IExpando extension method that gets a member value using lax rules.
Declaration
public static T GetLaxValue<T>(this IIndexable expando, string member, T defaultValue = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IIndexable | expando | The expando to act on. |
| System.String | member | The member. |
| T | defaultValue | Optional. The default value. |
Returns
| Type | Description |
|---|---|
| T | The lax value. |
Type Parameters
| Name | Description |
|---|---|
| T | The value type. |
Remarks
The member name may be either Pascal or camel case, and in case it is a string it is tried to be parsed.
Merge<T>(T, Object)
Merges the source object properties into the expando.
Declaration
public static T Merge<T>(this T expando, object source)
where T : IExpando
Parameters
| Type | Name | Description |
|---|---|---|
| T | expando | The expando to act on. |
| System.Object | source | Source object to be merged into the expando. |
Returns
| Type | Description |
|---|---|
| T | The target expando object. |
Type Parameters
| Name | Description |
|---|---|
| T | The expando type. |
Remarks
Collections of key-value pairs (including dictionaries) are merged by their keys, provided the key has the type of string.