/// <summary> /// Convert Zerobased.CountValue to System.Int32 value. /// </summary> /// <param name="topValue">Value to convert.</param> /// <returns> /// Returns <value>Defaul</value> if value less then <value>1</value>. /// Returns <value>NULL</value> if <paramref name="topValue"/> is <value>NoLimit</value>. /// </returns> public static int?AsInt32(this PageSizeValue topValue) { int?value = null; if (topValue != PageSizeValue.NoLimit) { value = (int)(topValue < PageSizeValue.First ? PageSizeValue.Default : topValue); } return(value); }
public ListOptions(PageSizeValue pageSize) : this(pageSize.AsInt32()) { }