src/Foundation/Data/Gimela.Data.JsonExtension/DynamicJson.cs
/// <summary>
/// Provides implementation for type conversion operations. Classes derived from the <see cref="T:System.Dynamic.DynamicObject"/> class can override this method to specify dynamic behavior for operations that convert an object from one type to another.
/// </summary>
/// <param name="binder">Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the <see cref="T:System.Dynamic.DynamicObject"/> class, binder.Type returns the <see cref="T:System.String"/> type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion.</param>
/// <param name="result">The result of the type conversion operation.</param>
/// <returns>
/// true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.)
/// </returns>
Provides implementation for type conversion operations. Classes derived from the  class can override this method to specify dynamic behavior for operations that convert an object from one type to another.
Provides implementation for type conversion operations . Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another .
public override bool TryConvert(ConvertBinder binder, out object result)
    {
      if (binder.Type == typeof(IEnumerable) || binder.Type == typeof(object[]))
      {
        var ie = (IsArray)
            ? xml.Elements().Select(x => DynamicJsonHelper.ConvertElementToValue(x))
            : xml.Elements().Select(x => (dynamic)new KeyValuePair<string, object>(x.Name.LocalName, DynamicJsonHelper.ConvertElementToValue(x)));
        result = (binder.Type == typeof(object[])) ? ie.ToArray() : ie;
      }
      else
      {
        result = Deserialize(binder.Type);
      }
      return true;
    }
public override bool TryConvert ( ConvertBinder binder , out object result ) { if ( binder . Type == typeof ( IEnumerable ) || binder . Type == typeof ( object [ ] ) ) { var ie = ( IsArray ) ? xml . Elements ( ) . Select ( x => DynamicJsonHelper . ConvertElementToValue ( x ) ) : xml . Elements ( ) . Select ( x => ( dynamic ) new KeyValuePair < string , object > ( x . Name . LocalName , DynamicJsonHelper . ConvertElementToValue ( x ) ) ) ; result = ( binder . Type == typeof ( object [ ] ) ) ? ie . ToArray ( ) : ie ; } else { result = Deserialize ( binder . Type ) ; } return true ; }
Provides implementation for type conversion operations.
Provides implementation for type conversion operations .
// Deserialize or foreach(IEnumerable)
true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.)
true if the operation is successful ; otherwise false . If this method returns false the run - time binder of the language determines the behavior . ( In most cases a language - specific run - time exception is thrown . )
binder
ConvertBinder
Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the  class, binder.Type returns the  type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion.
Provides information about the conversion operation . The binder . Type property provides the type to which the object must be converted . For example for the statement ( String ) sampleObject in C# ( CType ( sampleObject Type ) in Visual Basic ) where sampleObject is an instance of the class derived from the class binder . Type returns the type . The binder . Explicit property provides information about the kind of conversion that occurs . It returns true for explicit conversion and false for implicit conversion .
object
out
result
The result of the type conversion operation.
The result of the type conversion operation .