Beispiel #1
0
        /// <summary>
        /// 设置表名
        /// </summary>
        /// <param name="alias">别名</param>
        /// <param name="schema">架构名</param>
        public void From <TEntity>(string alias = null, string schema = null) where TEntity : class
        {
            var entity = typeof(TEntity);
            var table  = _resolver.GetTableAndSchema(entity);

            _item = CreateSqlItem(table, schema, alias);
            _register.Register(entity, _resolver.GetAlias(entity, alias));
        }
Beispiel #2
0
        public void Update <TEntity>(string schema = null) where TEntity : class
        {
            var    entity = typeof(TEntity);
            string table  = _resolver.GetTableAndSchema(entity);

            _item = CreateSqlItem(table, schema, null);
            _register.Register(entity, _resolver.GetAlias(entity, null));
        }
Beispiel #3
0
        /// <summary>
        /// 表连接
        /// </summary>
        private void Join <TEntity>(string joinType, string alias, string schema)
        {
            var type  = typeof(TEntity);
            var table = _resolver.GetTableAndSchema(type);

            _params.Add(CreateJoinItem(joinType, table, schema, alias));
            _register.Register(type, _resolver.GetAlias(type, alias));
        }
Beispiel #4
0
        /// <summary>
        /// 设置表名
        /// </summary>
        /// <param name="alias">别名</param>
        /// <param name="schema">架构名</param>
        public void From <TEntity>(string alias = null, string schema = null) where TEntity : class
        {
            var type  = typeof(TEntity);
            var table = Resolver.GetTableAndSchema(type);

            Table = CreateSqlItem(table, schema, alias);
            Register.Register(type, Resolver.GetAlias(type, alias));
            Register.FromType = type;
        }