none
Derived classes? RRS feed

  • Question

  • I have the following two tables:
    CREATE TABLE dbo.Strategy
    (
        StrategyID INT IDENTITY(1,1),
        ClientID INT,
        Field1 VARCHAR(100),
        Field2 VARCHAR(100),
        Field3 VARCHAR(100),
        UpdateTime DATETIME
    )
    CREATE TABLE dbo.StrategyAudit
    (
        StrategyAuditID INT IDENTITY(1,1),
        StrategyID INT,
        ClientID INT,
        Field1 VARCHAR(100),
        Field2 VARCHAR(100),
        Field3 VARCHAR(100),
        UpdateTime DATETIME
    )

    And triggers that add snapshots to the StrategyAudit any time you make a change to a strategy.
    I add both tables to the dbml file, but ideally I would like the StrategyAudit class generated to be derived from Strategy, because there are many times when you want to treat the StrategyAudit class as a Strategy.

    Any ideas on how to do this? Does EF support this?

    Wednesday, August 12, 2009 9:39 PM

Answers