public void Creation()
 {
     var TestObject = new Utilities.ORM.Parameters.AndParameter(new EqualParameter<int>(1, "Left"), new EqualParameter<int>(2, "Right"));
     Assert.Equal("(Left=@Left AND Right=@Right)", TestObject.ToString());
     IBatch Batch = new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll<IQueryProvider>()).Batch(TestDatabaseSource);
     Batch.AddCommand(null, null, "SELECT * FROM TestTable", CommandType.Text, TestObject).Execute();
 }
Esempio n. 2
0
        public void Creation()
        {
            var TestObject = new Utilities.ORM.Parameters.OrParameter(new EqualParameter <int>(1, "Left"), new EqualParameter <int>(2, "Right"));

            Assert.Equal("(Left=@Left OR Right=@Right)", TestObject.ToString());
            var Batch = new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll <IQueryProvider>()).Batch(TestDatabaseSource);

            Batch.AddCommand(null, null, "SELECT * FROM TestTable", CommandType.Text, TestObject).Execute();
        }
 public void Creation()
 {
     var TestObject = new BetweenParameter<int>(10, 12, "ID");
     Assert.Equal("ID", TestObject.ID);
     Assert.Equal(10, TestObject.Min);
     Assert.Equal(12, TestObject.Max);
     Assert.Equal("@", TestObject.ParameterStarter);
     Assert.Equal("ID BETWEEN @IDMin AND @IDMax", TestObject.ToString());
     Assert.Equal(DbType.Int32, TestObject.DatabaseType);
     Assert.Equal(ParameterDirection.Input, TestObject.Direction);
     var Batch = new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll<IQueryProvider>()).Batch(TestDatabaseSource);
     Batch.AddCommand(null, null, "SELECT * FROM TestTable", CommandType.Text, TestObject).Execute();
 }
 public void Creation()
 {
     var TestObject = new NotEqualParameter<int>(12, "ID");
     Assert.Equal("ID", TestObject.ID);
     Assert.Equal(12, TestObject.Value);
     Assert.Equal("@", TestObject.ParameterStarter);
     Assert.Equal("ID<>@ID", TestObject.ToString());
     Assert.Equal(DbType.Int32, TestObject.DatabaseType);
     Assert.Equal(ParameterDirection.Input, TestObject.Direction);
     Assert.Equal("ID", TestObject.FieldName);
     Assert.Equal(12, TestObject.InternalValue);
     IBatch Batch = new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll<IQueryProvider>()).Batch(TestDatabaseSource);
     Batch.AddCommand(null, null, "SELECT * FROM TestTable", CommandType.Text, TestObject).Execute();
 }
Esempio n. 5
0
        public void Creation()
        {
            var TestObject = new BetweenParameter <int>(10, 12, "ID");

            Assert.Equal("ID", TestObject.ID);
            Assert.Equal(10, TestObject.Min);
            Assert.Equal(12, TestObject.Max);
            Assert.Equal("@", TestObject.ParameterStarter);
            Assert.Equal("ID BETWEEN @IDMin AND @IDMax", TestObject.ToString());
            Assert.Equal(DbType.Int32, TestObject.DatabaseType);
            Assert.Equal(ParameterDirection.Input, TestObject.Direction);
            var Batch = new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll <IQueryProvider>()).Batch(TestDatabaseSource);

            Batch.AddCommand(null, null, "SELECT * FROM TestTable", CommandType.Text, TestObject).Execute();
        }
 public void Creation()
 {
     var TestObject = new Utilities.ORM.Parameters.LikeParameter("ASDF", "ID", 100);
     Assert.Equal("ID", TestObject.ID);
     Assert.Equal("ASDF", TestObject.Value);
     Assert.Equal("@", TestObject.ParameterStarter);
     Assert.Equal("ID LIKE @ID", TestObject.ToString());
     Assert.Equal(100, TestObject.Length);
     Assert.Equal(DbType.String, TestObject.DatabaseType);
     Assert.Equal(ParameterDirection.Input, TestObject.Direction);
     Assert.Equal("ID", TestObject.FieldName);
     Assert.Equal("ASDF", TestObject.InternalValue);
     var Batch = new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll<IQueryProvider>()).Batch(TestDatabaseSource);
     Batch.AddCommand(null, null, "SELECT * FROM TestTable", CommandType.Text, TestObject).Execute();
 }
        public void Creation()
        {
            var TestObject = new NotEqualParameter <int>(12, "ID");

            Assert.Equal("ID", TestObject.ID);
            Assert.Equal(12, TestObject.Value);
            Assert.Equal("@", TestObject.ParameterStarter);
            Assert.Equal("ID<>@ID", TestObject.ToString());
            Assert.Equal(DbType.Int32, TestObject.DatabaseType);
            Assert.Equal(ParameterDirection.Input, TestObject.Direction);
            Assert.Equal("ID", TestObject.FieldName);
            Assert.Equal(12, TestObject.InternalValue);
            IBatch Batch = new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll <IQueryProvider>()).Batch(TestDatabaseSource);

            Batch.AddCommand(null, null, "SELECT * FROM TestTable", CommandType.Text, TestObject).Execute();
        }
        public void Creation()
        {
            var TestObject = new Utilities.ORM.Parameters.LikeParameter("ASDF", "ID", 100);

            Assert.Equal("ID", TestObject.ID);
            Assert.Equal("ASDF", TestObject.Value);
            Assert.Equal("@", TestObject.ParameterStarter);
            Assert.Equal("ID LIKE @ID", TestObject.ToString());
            Assert.Equal(100, TestObject.Length);
            Assert.Equal(DbType.String, TestObject.DatabaseType);
            Assert.Equal(ParameterDirection.Input, TestObject.Direction);
            Assert.Equal("ID", TestObject.FieldName);
            Assert.Equal("ASDF", TestObject.InternalValue);
            var Batch = new Utilities.ORM.Manager.QueryProvider.Manager(Utilities.IoC.Manager.Bootstrapper.ResolveAll <IQueryProvider>()).Batch(TestDatabaseSource);

            Batch.AddCommand(null, null, "SELECT * FROM TestTable", CommandType.Text, TestObject).Execute();
        }
        public void Setup(ISourceInfo Source, Utilities.ORM.Manager.Mapper.Manager MappingProvider, Utilities.ORM.Manager.QueryProvider.Manager QueryProvider)
        {
            QueryProvider.Generate <ClassType>(Source, this, MappingProvider.GetStructure(DatabaseConfigType))
            .SetupCommands(this);

            foreach (IProperty Property in Properties)
            {
                if (Property is IMultiMapping ||
                    Property is ISingleMapping ||
                    Property is IMap)
                {
                    Property.Setup(Source, MappingProvider, QueryProvider);
                }
            }
        }