public static SortParams FromValue(object value) { if (value is SortParams) { return((SortParams)value); } var array = value != null?AnyValueArray.FromValue(value) : new AnyValueArray(); return(new SortParams(array)); }
/// <summary> /// Converts specified value into ProjectionParams. /// </summary> /// <param name="value">value to be converted</param> /// <returns>a newly created ProjectionParams.</returns> /// See <see cref="AnyValueArray.FromValue(object)"/> public static ProjectionParams FromValue(object value) { if (value is ProjectionParams) { return((ProjectionParams)value); } var array = value != null?AnyValueArray.FromValue(value) : new AnyValueArray(); return(new ProjectionParams(array)); }
/// <summary> /// Converts map element into an AnyValueArray or returns empty AnyValueArray if conversion is not possible. /// </summary> /// <param name="key">a key of element to get.</param> /// <returns>AnyValueArray value of the element or empty AnyValueArray if conversion is not supported.</returns> /// See <see cref="AnyValueArray.FromValue(object)"/> public AnyValueArray GetAsArray(string key) { return(AnyValueArray.FromValue(GetAsObject(key))); }
/// <summary> /// Converts map element into an AnyValueArray or returns null if conversion is not possible. /// </summary> /// <param name="key">a key of element to get.</param> /// <returns>AnyValueArray value of the element or null if conversion is not supported.</returns> /// See <see cref="AnyValueArray"/> public AnyValueArray GetAsNullableArray(string key) { var value = GetAsObject(key); return(value != null?AnyValueArray.FromValue(value) : null); }
/// <summary> /// Converts object value into an AnyArray or returns empty AnyArray if conversion is not possible. /// </summary> /// <returns>AnyArray value or empty AnyArray if conversion is not supported.</returns> /// See <see cref="AnyValueArray.FromValue(object)"/> public AnyValueArray GetAsArray() { return(AnyValueArray.FromValue(Value)); }
/// <summary> /// Converts map element into an AnyValueArray or returns empty AnyValueArray if conversion is not possible. /// </summary> /// <param name="key">a key of element to get.</param> /// <returns>AnyValueArray value of the element or empty AnyValueArray if conversion is not supported.</returns> /// See <see cref="AnyValueArray.FromValue(object)"/> public AnyValueArray GetAsArray(string key) { var value = GetAsObject(key); return(AnyValueArray.FromValue(key)); }