/// <summary> /// 获取列名列表 /// </summary> /// <param name="dialect">Sql方言</param> /// <param name="register">实体别名注册器</param> public string ToSql(IDialect dialect, IEntityAliasRegister register) { if (Raw || IsAggregation) { return(dialect.GetColumn(Name, dialect.GetSafeName(ColumnAlias))); } var result = new SqlItem(Name, GetTableAlias(register), ColumnAlias, isResolve: false); return(result.ToSql(dialect)); }
/// <summary> /// 获取列名列表 /// </summary> /// <param name="dialect">Sql方言</param> /// <param name="register">实体别名注册器</param> public string ToSql(IDialect dialect, IEntityAliasRegister register) { if (Raw || IsAggregation && TableType == null && string.IsNullOrWhiteSpace(AggregationFunc)) { return(dialect.GetColumn(Name, dialect.GetSafeName(ColumnAlias))); } var result = new SqlItem(Name, GetTableAlias(register), ColumnAlias, isResolve: false, aggregationFunc: AggregationFunc); return(result.ToSql(dialect)); }
/// <summary> /// 获取安全名称 /// </summary> /// <param name="dialect">Sql方言</param> /// <param name="name">名称</param> protected string GetSafeName(IDialect dialect, string name) => dialect.GetSafeName(name);
/// <summary> /// 获取安全名称 /// </summary> protected string GetSafeName(IDialect dialect, string name) { return(dialect.GetSafeName(name)); }