Example #1
0
 /// <summary>
 /// Converts array element into a long or returns null if conversion is not possible.
 /// </summary>
 /// <param name="index">an index of element to get.</param>
 /// <returns>long value of element or null if conversion is not supported.</returns>
 /// See <see cref="LongConverter.ToNullableLong(object)"/>
 public long?GetAsNullableLong(int index)
 {
     return(LongConverter.ToNullableLong(this[index]));
 }
Example #2
0
 public long?GetAsNullableLong()
 {
     return(LongConverter.ToNullableLong(Value));
 }
Example #3
0
        /// <summary>
        /// Converts map element into a long or returns null if conversion is not possible.
        /// </summary>
        /// <param name="key">a key of element to get.</param>
        /// <returns>long value of the element or null if conversion is not supported.</returns>
        /// See <see cref="LongConverter.ToNullableLong(object)"/>
        public long?GetAsNullableLong(string key)
        {
            var value = Get(key);

            return(LongConverter.ToNullableLong(value));
        }
Example #4
0
 /// <summary>
 /// Creates a new instance and sets its values.
 /// </summary>
 /// <param name="skip">the number of items to skip.</param>
 /// <param name="take">the number of items to return.</param>
 /// <param name="total">true to return the total number of items.</param>
 public PagingParams(object skip, object take, object total = null)
 {
     Skip  = LongConverter.ToNullableLong(skip);
     Take  = LongConverter.ToNullableLong(take);
     Total = BooleanConverter.ToBooleanWithDefault(total, false);
 }