Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当实体配置Column名且属性名和字段名不一致时,设置 FieldAliasOptions.AsProperty 并未生成别名 #1851

Open
Wolffy101 opened this issue Jul 4, 2024 · 0 comments · May be fixed by #1852

Comments

@Wolffy101
Copy link
Contributor

freeSql.Select<Account2>().ToSql(p => p, FieldAliasOptions.AsProperty).Dump();
public class Account2
{
    [Column("FID")]
    public int Id { get; set; }
    [Column("FName")]
    public string FName1 { get; set; }
}
-- 生成的Sql:
SELECT a.`FID`, a.`FName` 
FROM `Account2` a
-- 正确的sql
SELECT a.`FID` Id, a.`FName`  FName1 
FROM `Account2` a

数据库版本
Mysql 8.0

安装的Nuget包
v3.2.832

. net 6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant