我正在使用实体框架 5 在 C# 中进行编码,并且我有一个类似这样的模型凭证:
public class Voucher
{
public int Id { get; set; }
public int AppId { get; set; }
public virtual App {get; set;}
public int? TradeMemberId { get; set; }
public int FiscalPeriodId { get; set; }
}
我已将此模型配置为:
ToTable("Voucher", "acc");
使其映射到:
[acc].[凭证]
我的 App 属性来自同一个数据库,但在另一个模式中:
[prf].[应用程序]
现在,当 ef 尝试查询和填充 App 导航属性时,它在 acc 架构中找不到它。我如何像我们为模型做的那样将此属性标记为 prf 架构?任何帮助表示赞赏。