コード例 #1
0
        public static void Main()
        {
            GenerateQuery t = new GenerateQuery();

            Person person = new Person()
            {
                Id          = 1,
                PersonAge   = 12,
                PersonLName = "bidzia",
                PersonName  = "backsoon"
            };

            Console.WriteLine("Select: " + t.GenerateSelectQuery(person, new List <string> {
                "id > 1", "id < 100"
            }));
            //
            Console.WriteLine("insert: " + t.GenerateInsertQuery(person));
            Console.WriteLine("Update: " + t.GenerateUpdateQuery(person, new List <string> {
                "id = 11"
            }));
            Console.WriteLine("Delete: " + t.GenerateDeleteQuery(person, new List <string> {
                "id = 11"
            }));

            Console.ReadKey();
        }
コード例 #2
0
        public int InsertTakeId(T entity)
        {
            var sql = GenerateQuery <T> .GenerateInsertQuery(true);

            return(_dbConnection.Execute(sql, entity));
        }
コード例 #3
0
        public bool Insert(T entity)
        {
            var sql = GenerateQuery <T> .GenerateInsertQuery(false);

            return(_dbConnection.Execute(sql, entity) > 0);
        }