Beispiel #1
0
        public void GetByIdTest()
        {
            GXSelectArgs arg = GXSelectArgs.SelectById <TestIDClass>(1);

            Assert.AreEqual("SELECT `ID`, `Text` FROM TestIDClass WHERE ID=1", arg.ToString());
        }
Beispiel #2
0
        public void GetByIdColumnsTest()
        {
            GXSelectArgs arg = GXSelectArgs.SelectById <TestIDClass>(1, q => q.Id);

            Assert.AreEqual("SELECT `ID` FROM TestIDClass WHERE ID=1", arg.ToString());
        }
        public T SelectById <T>(long id)
        {
            GXSelectArgs arg = GXSelectArgs.SelectById <T>(id);

            return(Db.SingleOrDefault <T>(arg));
        }