Skip to content

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

@NKidding

Description

@NKidding

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions