C# 使用fluent nhibernate表继承删除对象时发生异常

C# 使用fluent nhibernate表继承删除对象时发生异常,c#,nhibernate,inheritance,fluent-nhibernate,C#,Nhibernate,Inheritance,Fluent Nhibernate,使用fluent nhibernate表继承删除对象时出现异常 我不知道我的应用程序结构和映射有什么不正确的地方,为什么在我使用表继承时它会寻找多对多映射表 添加和更新工作正常 我没有明确设置任何映射,我使用默认的fluent nhibernate映射 对于处理我的级联的覆盖例外情况,如下所示: public class CascadeAll : IHasOneConvention, IHasManyConvention, IReferenceConvention { public vo

使用fluent nhibernate表继承删除对象时出现异常

我不知道我的应用程序结构和映射有什么不正确的地方,为什么在我使用表继承时它会寻找多对多映射表

添加和更新工作正常

我没有明确设置任何映射,我使用默认的fluent nhibernate映射

对于处理我的级联的覆盖例外情况,如下所示:

public class CascadeAll : IHasOneConvention, IHasManyConvention, IReferenceConvention
{
    public void Apply(IOneToOneInstance instance)
    {
        instance.Cascade.All();
    }

    public void Apply(IOneToManyCollectionInstance instance)
    {
        instance.Cascade.All();
    }

    public void Apply(IManyToOneInstance instance)
    {
        instance.Cascade.All();
    }
} 
例外情况是:

Invalid object name 'BlogPageToPage'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'BlogPageToPage'.
我的数据库看起来像这样

Page
    Id (Guid)  
    Name  
    etc. 

BlogPage  
    Page_Id (Guid, exact same as parent page)  
   etc.
课程:

public class Page : EntityBase 
{
    public Page()
    { 
        BlogPages = new List<BlogPage>(); 
    }

    public virtual IList<BlogPage> BlogPages { get; set; } 

}


public class BlogPage : Page
{
    public BlogPage()
    { 
    }

    public virtual IList<Post> Posts { get; set; } 
}

谢谢您的输入。

“BlogPageToPage”与您的任何数据库、表或列名都不匹配……您能找到您提到的“BlogPageToPage”对象的位置吗?

当然,我是个白痴

它查找该表的原因是因为我在作为父对象的页面对象上有BlogPages作为列表

因此,当我尝试删除它时,它只是认为应该有另一个表来匹配该关联

违规线路:

    public virtual IList<BlogPage> BlogPages { get; set; }
公共虚拟IList博客页面{get;set;}

Hi,这是我问题的核心,根据我对表继承的理解,我不应该在数据库中需要该表,它是异常的,因为它丢失了,但为什么需要它呢?我知道异常是因为缺少一个表,我的问题更多——为什么我的继承映射应该意味着它不是必需的,而它却要求那个表呢。谢谢。这和我数据库中的级联规则有什么关系吗?
    public virtual IList<BlogPage> BlogPages { get; set; }