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

IncludeMany+ManyToMany如果使用了AsTable, 中间表song_tag没有使用AsTable处理表名 #1103

Closed
NKidding opened this issue May 13, 2022 · 1 comment

Comments

@NKidding
Copy link

Freesql 版本3.2.500
数据库Postgres9

IncludeMany+ManyToMany如果使用了AsTable 中间表song_tag没有使用AsTable处理表名导致报错 System.Exception : 42P01: relation "song_tag" does not exist

freeSql.CodeFirst.SyncStructure(typeof(Song), "1_song");
freeSql.CodeFirst.SyncStructure(typeof(Song_tag), "1_song_tag");
freeSql.CodeFirst.SyncStructure(typeof(Tag), "1_tag");

//不使用AsTable没问题
var list = freeSql.Select<Song>()
    .IncludeMany(a => a.Tags)
    .ToList();

//使用AsTable没有找指定的关联表 在then中指定也没起作用
var list1 = freeSql.Select<Song>()
    .AsTable((type, oname) => $"1_{oname}")
    .IncludeMany(a => a.Tags,then=>then.AsTable((type, oname) => $"1_{oname}"))
    .ToList();
//这里报异常 System.Exception : 42P01: relation "song_tag" does not exist
@2881099
Copy link
Collaborator

2881099 commented May 13, 2022

目前 song AsTable 可以传播到 then 以下所有查询,但是没有传播到 song_tag

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

No branches or pull requests

3 participants