예제 #1
0
        public void FromType()
        {
            var typeProvider = new MySqlDataTypeProvider();
            var dbType       = typeProvider.From(typeof(Binary));

            dbType = typeProvider.From(typeof(byte[]));
            Console.WriteLine(dbType.ToQueryString());
        }
예제 #2
0
        public void ToQueryString()
        {
            var target   = new MySqlDataTypeProvider();
            var dataType = target.From(typeof(string));
            var dbType   = dataType.ToQueryString();

            Assert.AreEqual("VARCHAR(4000)", dbType);

            dataType = target.From(typeof(string), 100);
            dbType   = dataType.ToQueryString();
            Assert.AreEqual("VARCHAR(100)", dbType);

            var sqlType = target.From(typeof(Binary));

            dbType = sqlType.ToQueryString();
            Console.WriteLine(dbType);
        }