コード例 #1
0
        /// <summary>
        /// Returns the SQLiteValue as a <see cref="Guid"/>.
        /// </summary>
        public static Guid ToGuid(this ResultSetValue This)
        {
            if (!Utf8Parser.TryParse(This.ToBlob(), out Guid value, out _))
            {
                ThrowHelper.ThrowFormatException();
            }

            return(value);
        }
コード例 #2
0
        /// <summary>
        /// Returns the SQLiteValue as a <see cref="Uri"/>.
        /// </summary>
        public static Uri ToUri(this ResultSetValue This)
        {
            var text = This.ToString();

            return(new Uri(text));
        }
コード例 #3
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="sbyte"/>.
 /// </summary>
 public static sbyte ToSByte(this ResultSetValue This)
 => Convert.ToSByte(This.ToInt64());
コード例 #4
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="UInt16"/>.
 /// </summary>
 public static UInt16 ToUInt16(this ResultSetValue This)
 => Convert.ToUInt16(This.ToInt64());
コード例 #5
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="short"/>.
 /// </summary>
 public static short ToShort(this ResultSetValue This)
 => Convert.ToInt16(This.ToInt64());
コード例 #6
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="uint"/>.
 /// </summary>
 public static uint ToUInt32(this ResultSetValue This)
 => Convert.ToUInt32(This.ToInt64());
コード例 #7
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="decimal"/>.
 /// </summary>
 public static decimal ToDecimal(this ResultSetValue This)
 => Convert.ToDecimal(This.ToDouble());
コード例 #8
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="DateTimeOffset"/>.
 /// </summary>
 public static DateTimeOffset ToDateTimeOffset(this ResultSetValue This)
 => new DateTimeOffset(This.ToInt64(), TimeSpan.Zero);
コード例 #9
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="DateTime"/>.
 /// </summary>
 public static DateTime ToDateTime(this ResultSetValue This)
 => new DateTime(This.ToInt64());
コード例 #10
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="TimeSpan"/>.
 /// </summary>
 public static TimeSpan ToTimeSpan(this ResultSetValue This)
 => new TimeSpan(This.ToInt64());
コード例 #11
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="float"/>.
 /// </summary>
 public static float ToFloat(this ResultSetValue This)
 => (float)This.ToDouble();
コード例 #12
0
 /// <summary>
 /// Returns the SQLiteValue as a <see cref="bool"/>.
 /// </summary>
 public static bool ToBool(this ResultSetValue This)
 => Convert.ToBoolean(This.ToInt64());