Best way to model different options in EF Core

I have a class that's used to define the integration parameters for a particular process. Now, I have integration options A,B,C, etc each of which correspond to different tables with different IDs I need to populate on my class.

ex
c#
public class myclass {
    public string MyParam1 { get; set; }
    public string MyParam2 { get; set; }
    public string MyParam3 { get; set; }

    // Integration A
    public Guid PackageId { get; set; }
    public Guid LocationId { get; set; }
    public Guid ScreenElementId { get; set; }
    // Integration B
    public Guid PackageId { get; set; }
    public Guid LocationId { get; set; }
    public Guid ScreenElementId { get; set; }
    // etc
}


Now, only 1 integration is supported for each instance of myclass. I could in theory define each available integration's FK references in this table, but there must be a better way to do this?

c#
public class myclass {
    public string MyParam1 { get; set; }
    public string MyParam2 { get; set; }
    public string MyParam3 { get; set; }

    // Integration
    public IntegrationType Integration { get; set; } // A,B,C,etc
    public Guid IntegrationId { get; set; } // But wouldn't this just then be a table with all references, like in the previous example?
}
Was this page helpful?