Ok, this takes a bit of setup first.
public interface IPolicyObjectAdapter
{
PolicyImage GetPolicyImage(BridgePolicy policy);
}
public class BridgePolicyAdapter : IPolicyObjectAdapter
{
protected virtual PolicyImage GetPolicyImage(BridgePolicy policy)
{
AddPolicyInformation(policy);
}
protected virtual void AddPolicyInformation(BridgePolicy policy)
{
//does stuff
}
}
public class HSPolicyAdapter : BridgePolicyAdapter, IPolicyObjectAdapter
{
protected override void AddPolicyInformation(BridgePolicy policy)
{
base.AddPolicyInformation(policy);
//does more stuff
}
}
When I execute the following code, I expect the code to enter into the HSPolicyAdapter's AddPolicyInformation method. But it never does. It just goes straight into the BridgePolicyAdapters AddPolicyInformation method.
IPolicyObjectAdapter Adapter = null;
Adapter = new HSPolicyAdapter();
PolicyImage image = Adapter.GetPolicyImage(policy);
I am sure I am missing something so obvious it will hurt, but my brain isnt working right now. What am I missing?
base.AddPolyInformation(polyicy, Img). What's with theImgparameter? I think you'll need to post an actual working code set for us to test. On the face of it, it seems that you have the overall concept right, but likely there's just a small oversight but we can't answer it without more accurate information from you.base.AddPolicty..., so if you put a break-point there, it should hit.