dotnetcore / dotnetcore/FreeSql

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

Open
#1,851 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
910
PR merge metrics
No merged PRs in 30d

Description


```c#
freeSql.Select().ToSql(p => p, FieldAliasOptions.AsProperty).Dump();
public class Account2
{
[Column("FID")]
public int Id { get; set; }
[Column("FName")]
public string FName1 { get; set; }
}
```

```sql
-- 生成的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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.