sdk/dotnet/src/Microsoft.Datasync.Client.SQLiteStore/Utils/SqlColumnType.cs
/// <summary>
/// Gets the store type from a .NET type.
/// </summary>
/// <param name="type">The .NET type.</param>
/// <returns>The store type</returns>
/// <exception cref="NotSupportedException">If the .NET type cannot be supported.</exception>
Gets the store type from a .NET type.
Gets the store type from a . NET type .
public static string GetStoreCastType(Type type)
        {
            if (type == typeof(bool) || type == typeof(DateTime) || type == typeof(decimal))
            {
                return Numeric;
            }
            else if (type == typeof(int) || type == typeof(uint) ||
                     type == typeof(long) || type == typeof(ulong) ||
                     type == typeof(short) || type == typeof(ushort) ||
                     type == typeof(byte) || type == typeof(sbyte))
            {
                return Integer;
            }
            else if (type == typeof(float) || type == typeof(double))
            {
                return Real;
            }
            else if (type == typeof(string) || type == typeof(Guid) || type == typeof(byte[]) || type == typeof(Uri) || type == typeof(TimeSpan))
            {
                return Text;
            }
            throw new NotSupportedException($"Type '{type.FullName}' not supported in SQLite.");
        }
public static string GetStoreCastType ( Type type ) { if ( type == typeof ( bool ) || type == typeof ( DateTime ) || type == typeof ( decimal ) ) { return Numeric ; } else if ( type == typeof ( int ) || type == typeof ( uint ) || type == typeof ( long ) || type == typeof ( ulong ) || type == typeof ( short ) || type == typeof ( ushort ) || type == typeof ( byte ) || type == typeof ( sbyte ) ) { return Integer ; } else if ( type == typeof ( float ) || type == typeof ( double ) ) { return Real ; } else if ( type == typeof ( string ) || type == typeof ( Guid ) || type == typeof ( byte [ ] ) || type == typeof ( Uri ) || type == typeof ( TimeSpan ) ) { return Text ; } throw new NotSupportedException ( $" Type ' { type . FullName } ' not supported in SQLite. " ) ; }
Gets the store type from a .NET type.
Gets the store type from a . NET type .
The store type
The store type
If the .NET type cannot be supported.
If the . NET type cannot be supported .
type
Type
The .NET type.
The . NET type .