dotnetcore / FreeSql

🦄 .NET aot orm, C# orm, VB.NET orm, Mysql orm, Postgresql orm, SqlServer orm, Oracle orm, Sqlite orm, Firebird orm, 达梦 orm, 人大金仓 orm, 神通 orm, 翰高 orm, 南大通用 orm, 虚谷 orm, 国产 orm, Clickhouse orm, QuestDB orm, MsAccess orm.
http://freesql.net
MIT License
3.99k stars 842 forks source link

查询时枚举转 int再转字符串报错 referenced from scope '', but it is not defined #1781

Open NKidding opened 1 month ago

NKidding commented 1 month ago
[Fact]
public async Task Test2()
{
    var freeSql = provider.GetService<IFreeSql>();
    var model = await  freeSql.Select<TestEntity1>().FirstAsync(s => new
    {
        State = ((int)s.State).ToString()
    });
}

public class TestEntity1
{
    [Column(Name = "id", IsIdentity = true, IsPrimary = true)]
    public int Id { get; set; }

    public TestState State { get; set; }
}

FreeSql版本 :3.2.821(最新几个版本试了都有这个问题 3.2.6n没问题)

数据库:Postgres 14

2881099 commented 1 month ago

已处理,留意