/// <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)); }
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)); }
/// <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)); }
/// <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; }