I am trying to implement a hierarchical inheritance structure in Entity Framework, specifically for settings. For example, lets say we have user preferences:

```
public class StorePreference: Preference { }

public class UserPreference : Preference { }

public class Preference {
public string BackgroundColor { get; set; }
public ContactMethod ContactMethod { get; set; }
}

public enum ContactMethod {
  SMS,
  Email
}

```

I'd like it so that if I lookup the user's preferences. If the user doesn't exist or the property value is null, it looks up the parent (store) default preferences.

Ideally, i'd like it to work similar to abstract inheritance:

```
public class UserPreference : StorePreference {
    private string _backgroundColor;

    public string BackgroundColor {
        get { 
           if (this._backgroundColor == null)
              return base;

           return this._backgroundColor;
        } 
        set { this._backgroundColor = value; }
    }
}

```

If I were to write this as a SQL query, it'd be a CROSS APPLY with a CASE statement:

```
SELECT 
    CASE WHEN User.BackgroundColor == null THEN Store.BackgroundColor ELSE User.BackgroundColor END BackgroundColor,
    CASE WHEN User.ContactMethod == null THEN Store.ContactMethod ELSE User.ContactMethod END ContactMethod
FROM UserPreference User
CROSS APPLY StorePreference Store
WHERE UserPreference.UserId = @UserId

```

Is there a way I can achieve loading this in EF?