You can't, it doesn't make sense.
the settings action you pass to StartUpMethod
is typed to Derived and will be entitled to use the interface of SettingsDerived
. You can't then give it a base class and expect it to just handle it.
eg, if I have...
public class SettingsDerived : SettingsBase
{
public string DerivedSetting { get; set; }
}
I'm entitled to do :-
y.StartUpMethod( a => a.DerivedSetting = "blah" );
but in the method1 you are trying to give it a SettingsBase s = new SettingsBase();
which won't have the DerivedSetting