Click here to Skip to main content
15,504,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need to set more than one discriminate values for parent class. Is it possible to do and how?
For example:

PARENT_CLASS

DiscriminateSubClassesOnColumn("COLUMN_NAME", "X");

CHILD_CLASS_1

DiscriminatorValue("Y");

CHILD_CLASS_2

DiscriminatorValue("Z");

This is possible. But what if i have more than these 3 values in column "COLUMN_NAME"?

For example if "P" and "Q" are also possible values for that column what should i write?

DiscriminateSubClassesOnColumn("COLUMN_NAME", "X","P","Q"); Obviously this is not possible to write. But i don't know how to do this. Can someone help me?

Thanks.
Posted

1 solution

C#
ENTITY:

public partial class InsuranceApprovalInvoice : OrderInsuranceApproval
    {
        [DataMember()]
        public virtual PatientInvoice PatientInvoice { get; set; }

    }
    public partial class InsuranceApprovalOrder : OrderInsuranceApproval
    {
        [DataMember()]
        public virtual Order Order { get; set; }

    }
    public partial class InsuranceApprovalPackage : OrderInsuranceApproval
    {
        [DataMember()]
        public virtual TreatmentPlanPackages TreatmentPlanPackages { get; set; }

    }

MAPPER:

DiscriminateSubClassesOnColumn("ObjectTypeID").AlwaysSelectWithValue()
                .SubClass<insuranceapprovalinvoice>((int) InsuranceApprovalTypeEnum.Invoice,
                m => m.References(p => p.PatientInvoice, "InvoiceMasterID").Column("ObjectID").ReadOnly())
                    
                .SubClass<insuranceapprovalorder>((int) InsuranceApprovalTypeEnum.Order,
                    m => m.References(p => p.Order, "OrderID").Column("ObjectID").ReadOnly())

                .SubClass<insuranceapprovalpackage>((int) InsuranceApprovalTypeEnum.Package,
                    m => m.References(p => p.TreatmentPlanPackages, "TreatmentPlanPackagesID").Column("ObjectID").ReadOnly());
</insuranceapprovalpackage></insuranceapprovalorder></insuranceapprovalinvoice>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900