Ejemplo n.º 1
0
 public static string GetCLRTypeAsString(UniDbTypes uniDbType)
 {
     switch (uniDbType)
     {
         case UniDbTypes.Array:
             //throw new NotImplementedException("No equivalent CLR type");
             return "object";
         case UniDbTypes.BigInt:
             return "long";
         case UniDbTypes.Binary:
             return "byte[]";
         case UniDbTypes.Bit:
             return "bool";
         case UniDbTypes.Blob:
             return "byte[]";
         case UniDbTypes.Boolean:
             return "bool";
         case UniDbTypes.Byte:
             return "byte";
         case UniDbTypes.Char:
             return "string";
         case UniDbTypes.Clob:
             return "string";
         case UniDbTypes.Currency:
             return "decimal";
         case UniDbTypes.Cursor:
             //return typeof(Int64);
             throw new NotImplementedException("No equivalent CLR type");
         case UniDbTypes.Date:
             return "DateTime";
         case UniDbTypes.DateTime:
             return "DateTime";
         case UniDbTypes.DateTime2:
             return "DateTime";
         case UniDbTypes.DateTimeOffset:
             return "DateTime";
         case UniDbTypes.Decimal:
             return "decimal";
         case UniDbTypes.Double:
             return "double";
         case UniDbTypes.Enum:
             return "string";
         case UniDbTypes.Fixed:
             return "decimal";
         case UniDbTypes.Float:
             return "float";
         case UniDbTypes.Geography:
             return "GeoAPI.Geometries.IGeography";
         case UniDbTypes.Geometry:
             return "GeoAPI.Geometries.IGeometry";
         case UniDbTypes.Guid:
             return "Guid";
         case UniDbTypes.HierarchyId:
             return "string";
         case UniDbTypes.Image:
             return "byte[]";
         case UniDbTypes.Int:
             return "int";
         case UniDbTypes.IntervalDS:
             return "TimeSpan";
         case UniDbTypes.IntervalYM:
             return "TimeSpan";
         case UniDbTypes.LongBlob:
             return "byte[]";
         case UniDbTypes.LongText:
             return "string";
         case UniDbTypes.MediumBlob:
             return "byte[]";
         case UniDbTypes.MediumInt:
             return "int";
         case UniDbTypes.MediumText:
             return "string";
         case UniDbTypes.Money:
             return "decimal";
         case UniDbTypes.NChar:
             return "string";
         case UniDbTypes.NClob:
             return "string";
         case UniDbTypes.NText:
             return "string";
         case UniDbTypes.Numeric:
             return "double";
         case UniDbTypes.NVarChar:
             return "string";
         case UniDbTypes.Object:
             return "object";
         case UniDbTypes.Real:
             return "float";
         case UniDbTypes.Set:
             return "string";
         case UniDbTypes.Single:
             return "double";
         case UniDbTypes.SmallDateTime:
             return "DateTime";
         case UniDbTypes.SmallInt:
             return "short";
         case UniDbTypes.SmallMoney:
             return "decimal";
         case UniDbTypes.SqlVariant:
             return "object";
         case UniDbTypes.Text:
             return "string";
         case UniDbTypes.Time:
             return "DateTime";
         case UniDbTypes.TimeStamp:
             return "DateTime";
         case UniDbTypes.TinyBlob:
             return "byte[]";
         case UniDbTypes.TinyInt:
             return "short";
         case UniDbTypes.TinyText:
             return "string";
         case UniDbTypes.UniqueIdentifier:
             return "Guid";
         case UniDbTypes.VarBinary:
             return "byte[]";
         case UniDbTypes.VarChar:
             return "string";
         case UniDbTypes.Xml:
             return "object";
         case UniDbTypes.Year:
             return "short";
         default:
             throw new NotImplementedException("UniDBType not handled yet: " + uniDbType.ToString());
     }
 }
Ejemplo n.º 2
0
        public static Type GetCLRType(UniDbTypes uniDbType)
        {
            switch (uniDbType)
            {
            case UniDbTypes.Array:
                throw new NotImplementedException("No equivalent CLR type");

            case UniDbTypes.BigInt:
                return(typeof(Int64));

            case UniDbTypes.Binary:
                return(typeof(byte[]));

            case UniDbTypes.Bit:
                return(typeof(Int16));

            case UniDbTypes.Blob:
                return(typeof(byte[]));

            case UniDbTypes.Boolean:
                return(typeof(bool));

            case UniDbTypes.Byte:
                return(typeof(Int16));

            case UniDbTypes.Char:
                return(typeof(string));

            case UniDbTypes.Clob:
                return(typeof(string));

            case UniDbTypes.Currency:
                return(typeof(decimal));

            case UniDbTypes.Cursor:
                //return typeof(Int64);
                throw new NotImplementedException("No equivalent CLR type");

            case UniDbTypes.Date:
                return(typeof(DateTime));

            case UniDbTypes.DateTime:
                return(typeof(DateTime));

            case UniDbTypes.Decimal:
                return(typeof(decimal));

            case UniDbTypes.Double:
                return(typeof(double));

            case UniDbTypes.Guid:
                return(typeof(Guid));

            case UniDbTypes.Int:
                return(typeof(Int32));

            case UniDbTypes.IntervalDS:
                return(typeof(TimeSpan));

            case UniDbTypes.IntervalYM:
                return(typeof(TimeSpan));

            case UniDbTypes.NChar:
                return(typeof(string));

            case UniDbTypes.NClob:
                return(typeof(string));

            case UniDbTypes.NVarChar:
                return(typeof(string));

            case UniDbTypes.Object:
                return(typeof(object));

            case UniDbTypes.Single:
                return(typeof(double));

            case UniDbTypes.SmallInt:
                return(typeof(Int16));

            case UniDbTypes.Time:
                return(typeof(DateTime));

            case UniDbTypes.TimeStamp:
                return(typeof(DateTime));

            case UniDbTypes.TinyInt:
                return(typeof(Int16));

            case UniDbTypes.VarChar:
                return(typeof(string));

            case UniDbTypes.Xml:
                return(typeof(object));

            case UniDbTypes.Year:
                return(typeof(short));

            case UniDbTypes.Enum:
                return(typeof(string));

            case UniDbTypes.Fixed:
                return(typeof(decimal));

            case UniDbTypes.LongBlob:
                return(typeof(byte[]));

            case UniDbTypes.LongText:
                return(typeof(string));

            case UniDbTypes.MediumBlob:
                return(typeof(byte[]));

            case UniDbTypes.MediumInt:
                return(typeof(int));

            case UniDbTypes.MediumText:
                return(typeof(string));

            case UniDbTypes.Set:
                return(typeof(string));

            case UniDbTypes.TinyBlob:
                return(typeof(byte[]));

            case UniDbTypes.TinyText:
                return(typeof(string));

            default:
                throw new NotImplementedException("UniDBType not handled yet: " + uniDbType.ToString());
            }
        }
Ejemplo n.º 3
0
        public static Type GetCLRType(UniDbTypes uniDbType)
        {
            switch (uniDbType)
            {
                case UniDbTypes.Array:
                    throw new NotImplementedException("No equivalent CLR type");
                case UniDbTypes.BigInt:
                    return typeof(Int64);
                case UniDbTypes.Binary:
                    return typeof(byte[]);
                case UniDbTypes.Bit:
                    return typeof(Int16);
                case UniDbTypes.Blob:
                    return typeof(byte[]);
                case UniDbTypes.Boolean:
                    return typeof(bool);
                case UniDbTypes.Byte:
                    return typeof(Int16);
                case UniDbTypes.Char:
                    return typeof(string);
                case UniDbTypes.Clob:
                    return typeof(string);
                case UniDbTypes.Currency:
                    return typeof(decimal);
                case UniDbTypes.Cursor:
                    //return typeof(Int64);
                    throw new NotImplementedException("No equivalent CLR type");
                case UniDbTypes.Date:
                    return typeof(DateTime);
                case UniDbTypes.DateTime:
                    return typeof(DateTime);
                case UniDbTypes.Decimal:
                    return typeof(decimal);
                case UniDbTypes.Double:
                    return typeof(double);
                case UniDbTypes.Guid:
                    return typeof(Guid);
                case UniDbTypes.Int:
                    return typeof(Int32);
                case UniDbTypes.IntervalDS:
                    return typeof(TimeSpan);
                case UniDbTypes.IntervalYM:
                    return typeof(TimeSpan);
                case UniDbTypes.NChar:
                    return typeof(string);
                case UniDbTypes.NClob:
                    return typeof(string);
                case UniDbTypes.NVarChar:
                    return typeof(string);
                case UniDbTypes.Object:
                    return typeof(object);
                case UniDbTypes.Single:
                    return typeof(double);
                case UniDbTypes.SmallInt:
                    return typeof(Int16);
                case UniDbTypes.Time:
                    return typeof(DateTime);
                case UniDbTypes.TimeStamp:
                    return typeof(DateTime);
                case UniDbTypes.TinyInt:
                    return typeof(Int16);
                case UniDbTypes.VarChar:
                    return typeof(string);
                case UniDbTypes.Xml:
                    return typeof(object);

                case UniDbTypes.Year:
                    return typeof(short);
                case UniDbTypes.Enum:
                    return typeof(string);
                case UniDbTypes.Fixed:
                    return typeof(decimal);
                case UniDbTypes.LongBlob:
                    return typeof(byte[]);
                case UniDbTypes.LongText:
                    return typeof(string);
                case UniDbTypes.MediumBlob:
                    return typeof(byte[]);
                case UniDbTypes.MediumInt:
                    return typeof(int);
                case UniDbTypes.MediumText:
                    return typeof(string);
                case UniDbTypes.Set:
                    return typeof(string);
                case UniDbTypes.TinyBlob:
                    return typeof(byte[]);
                case UniDbTypes.TinyText:
                    return typeof(string);
                default:
                    throw new NotImplementedException("UniDBType not handled yet: " + uniDbType.ToString());
            }
        }
Ejemplo n.º 4
0
        public static string GetCLRTypeAsString(UniDbTypes uniDbType)
        {
            switch (uniDbType)
            {
            case UniDbTypes.Array:
                //throw new NotImplementedException("No equivalent CLR type");
                return("object");

            case UniDbTypes.BigInt:
                return("long");

            case UniDbTypes.Binary:
                return("byte[]");

            case UniDbTypes.Bit:
                return("bool");

            case UniDbTypes.Blob:
                return("byte[]");

            case UniDbTypes.Boolean:
                return("bool");

            case UniDbTypes.Byte:
                return("byte");

            case UniDbTypes.Char:
                return("string");

            case UniDbTypes.Clob:
                return("string");

            case UniDbTypes.Currency:
                return("decimal");

            case UniDbTypes.Cursor:
                //return typeof(Int64);
                throw new NotImplementedException("No equivalent CLR type");

            case UniDbTypes.Date:
                return("DateTime");

            case UniDbTypes.DateTime:
                return("DateTime");

            case UniDbTypes.DateTime2:
                return("DateTime");

            case UniDbTypes.DateTimeOffset:
                return("DateTime");

            case UniDbTypes.Decimal:
                return("decimal");

            case UniDbTypes.Double:
                return("double");

            case UniDbTypes.Enum:
                return("string");

            case UniDbTypes.Fixed:
                return("decimal");

            case UniDbTypes.Float:
                return("float");

            case UniDbTypes.Geography:
                return("GeoAPI.Geometries.IGeography");

            case UniDbTypes.Geometry:
                return("GeoAPI.Geometries.IGeometry");

            case UniDbTypes.Guid:
                return("Guid");

            case UniDbTypes.HierarchyId:
                return("string");

            case UniDbTypes.Image:
                return("byte[]");

            case UniDbTypes.Int:
                return("int");

            case UniDbTypes.IntervalDS:
                return("TimeSpan");

            case UniDbTypes.IntervalYM:
                return("TimeSpan");

            case UniDbTypes.LongBlob:
                return("byte[]");

            case UniDbTypes.LongText:
                return("string");

            case UniDbTypes.MediumBlob:
                return("byte[]");

            case UniDbTypes.MediumInt:
                return("int");

            case UniDbTypes.MediumText:
                return("string");

            case UniDbTypes.Money:
                return("decimal");

            case UniDbTypes.NChar:
                return("string");

            case UniDbTypes.NClob:
                return("string");

            case UniDbTypes.NText:
                return("string");

            case UniDbTypes.Numeric:
                return("double");

            case UniDbTypes.NVarChar:
                return("string");

            case UniDbTypes.Object:
                return("object");

            case UniDbTypes.Real:
                return("float");

            case UniDbTypes.Set:
                return("string");

            case UniDbTypes.Single:
                return("double");

            case UniDbTypes.SmallDateTime:
                return("DateTime");

            case UniDbTypes.SmallInt:
                return("short");

            case UniDbTypes.SmallMoney:
                return("decimal");

            case UniDbTypes.SqlVariant:
                return("object");

            case UniDbTypes.Text:
                return("string");

            case UniDbTypes.Time:
                return("DateTime");

            case UniDbTypes.TimeStamp:
                return("DateTime");

            case UniDbTypes.TinyBlob:
                return("byte[]");

            case UniDbTypes.TinyInt:
                return("short");

            case UniDbTypes.TinyText:
                return("string");

            case UniDbTypes.UniqueIdentifier:
                return("Guid");

            case UniDbTypes.VarBinary:
                return("byte[]");

            case UniDbTypes.VarChar:
                return("string");

            case UniDbTypes.Xml:
                return("object");

            case UniDbTypes.Year:
                return("short");

            default:
                throw new NotImplementedException("UniDBType not handled yet: " + uniDbType.ToString());
            }
        }