如何在通过代码映射 Nhibernate 时为列表指定架构

How to specify Schema for Lists while mapping Nhibernate by code

我希望我的 "tag_post" table 在 "article" 架构中创建,但它是在 "public" 架构中创建的。

List(x => x.Tags, l =>
        {
            l.Where("deleted = 0");

            l.Key(k =>
            {
                k.Column("post_id");
                k.NotNullable(true);
            });
            Schema(Constants.DatabaseSchemaNames.Article);
            l.Table("tag_post");
        }, x =>
        {
            x.ManyToMany(m => m.Column("tag_id"));
        });

我从未使用过代码映射,但我认为这是解决方案:

List(x => x.Students, l =>
{
    l.Where("deleted = 0");

    l.Key(k =>
    {
        k.Column("post_id");
        k.NotNullable(true);
    });
    l.Schema(Constants.DatabaseSchemaNames.Article);
    l.Table("tag_post");
}, x =>
{
    x.ManyToMany(m => m.Column("tag_id"));
});