小编kia*_*osh的帖子

TPC继承错误

使用C#Entity Framework Codefirst和Fluent Api,我有一个TPC继承的奇怪问题.我有3类命名Person,Invoice并且PeriodicInvoice你可以看到下面.以下是我的代码摘要:

Invoice class及其配置类:

public class Invoice : InvoiceBase
{
    public Person User { get; set; }
}

public class InvoiceConfig : EntityTypeConfiguration<Invoice>
{
    public InvoiceConfig()
    {
        this.Map(m => { m.MapInheritedProperties(); m.ToTable("Invoices"); });
    }
}
Run Code Online (Sandbox Code Playgroud)

PeriodicInvoice 类及其配置:

public class PeriodicInvoice : InvoiceBase
{
    // Some extra properties.
} 

public class PeriodicInvoiceConfig : EntityTypeConfiguration<PeriodicInvoice>
{
    public PeriodicInvoiceConfig()
    {
       this.Property(x => x.SuspendOnExpire).IsRequired();
       this.Map(m => { m.MapInheritedProperties(); m.toTable("PeriodicInvoices"); });
    }
}
Run Code Online (Sandbox Code Playgroud)

当我运行代码时,会出现此错误:

实体类型"发票"和"人员"之间的关联"Invoice_User"无效.在TPC层次结构中,仅允许在大多数派生类型上使用独立关联.

我知道这意味着我应该将属性包含在User …

c# entity-framework ef-code-first ef-fluent-api

6
推荐指数
1
解决办法
1734
查看次数

无法使用 python3.6 pip 安装 pyldap

我正在尝试pyldap在 debian 中使用 python3.6 pip进行安装:

pip install pyldap 但我正面临这个错误:

----------------------------------------
Failed building wheel for pyldap
Running setup.py clean for pyldap
Failed to build pyldap
Installing collected packages: pyldap
Running setup.py install for pyldap ... error
    Complete output from command /home/ssc/VEnvs/newssc/bin/python3.6 -u -c 
"import setuptools, tokenize;__file__='/tmp/pip-build-
eqi2_xn9/pyldap/setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
__file__, 'exec'))" install --record /tmp/pip-qx8nvwny-record/install-
record.txt --single-version-externally-managed --compile --install-headers 
/home/ssc/VEnvs/newssc/include/site/python3.6/pyldap:
    defines: HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
    extra_compile_args:
    extra_objects:
    include_dirs: /usr/include /usr/include/sasl /usr/local/include 
/usr/local/include/sasl
    library_dirs: /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
    libs: ldap_r …
Run Code Online (Sandbox Code Playgroud)

debian python-3.6 pyldap

4
推荐指数
1
解决办法
1581
查看次数

django intcomma不适用于本地化

我正在使用django,但我发现intcomma模板标记无法在特殊语言中使用!

localeen它工作正常,但是当我想用波斯语语言(区域fa)没有真正发生,Django不人性化的数

django

1
推荐指数
1
解决办法
1202
查看次数