locked
Code First Inheritance Mapping RRS feed

  • Question

  • good morning

    In code first, using Table Per Hierarchy inheritance (TPH), it automatically adds a where clause in the query, putting the value of the "Discriminator".
    I have to use the TPH and retrieve all data without distinction? ie using inheritance, but we always come all the data.

    If I try to leave the "Discriminator" null as well as in the reference table inherited happens the following error when doing a search:


    (1217.10): error 3032: Problem in mapping fragments starting at lines 1208, 1217: EntityTypes Repositorio.UseMensagens, Repositorio.EcmMensagensFuncional
    are being mapped to the same rows in table UseMensagens. Mapping conditions can be used to Distinguish the rows That these types are mapped to.

    I always bring all data, regardless of Discriminator, is how to disable it?

    thank you
    Friday, October 26, 2012 1:18 PM