zoukankan      html  css  js  c++  java
  • DbEntry查询表的使用

    using System;
    using Lephone.Data;
    using Lephone.Data.Definition;

    using Lephone.Web;

    namespace Debug
    {
        public class TestClass1 : DbObject
        {
            public string Name;
        }

        public class TestClass2 : DbObject
        {
            public int Age;
        }

        [JoinOn(0, "TestClass1.Id", "TestClass2.Id", CompareOpration.Equal, JoinMode.Inner)]
        [CreateTableList(typeof(TestClass1), typeof(TestClass2))]
        public class JoinClass : IDbObject
        {
            public string Name;
            public int Age;
        }

        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Hellow world!");
                //DbEntry.Context.DropAndCreate(typeof(TestClass1));
                //DbEntry.Context.DropAndCreate(typeof(TestClass2));

                //TestClass1 t1 = new TestClass1();
                //t1.Name = "wxy";
                //DbEntry.Save(t1);

                //TestClass2 t2 = new TestClass2();
                //t2.Age = 1;
                //DbEntry.Save(t2);

                var list = DbEntry.From<JoinClass>().Where(null).Select();
                Console.WriteLine(list.Count);
                Console.ReadLine();
            }
        }
    }

  • 相关阅读:
    MYSQL优化
    linux 基础知识 之基础系统管理2
    mysql数据库读写分离+高可用
    Varnish代理缓存服务器
    tomcat
    Memcached, Redis, MongoDB区别、特点、使用场景
    session共享
    基于docker的zabbix服务搭建
    php-fpm 启动后没有监听端口9000
    学习网站
  • 原文地址:https://www.cnblogs.com/shiningrise/p/1619703.html
Copyright © 2011-2022 走看看