Why is my inherited class not hiding my base class method?
<p>I have a project which uses autofac to instantiate the objects</p>

<pre><code>    builder.RegisterType&lt;AbcWebWorkContext&gt;().As&lt;IWorkContext&gt;().InstancePerHttpRequest();
</code></pre>

<p>This AbcWebWorkContext is a Subclass of WebWorkContext:</p>

<pre><code>public partial class AbcWebWorkContext : WebWorkContext
</code></pre>

<p>In my AbcWebWorkContext I would like to hide a method and a property from the parent class</p>

<pre><code>protected new Customer GetCurrentCustomer(){ //do stuff }
new public Customer CurrentCustomer { //do studd }
</code></pre>

<p>But when someone calls</p>

<pre><code>_workContext.CurrentCustomer
</code></pre>

<p>The base class property is called. If I call it</p>

<pre><code>((AbcWebWorkContext) _workContext).CurrentCustomer
</code></pre>

<p>it works.</p>

<p>I would like to know why I am not able to hide the parent method.
I can't change the called class because it is in NopCommerce's core, which I would not like to change.</p>

<p>Why is it not hiding the method?</p>

<p>Thanks,
Oscar</p>

<p>Base class declaration of the methods:</p>

<pre><code>protected Customer GetCurrentCustomer() { // do stuff }
public Customer CurrentCustomer{ // do stuff }
</code></pre>

<p>calling gettype() on _workcontext will output </p>

<blockquote>
  <p>{Name = "AbcWebWorkContext" FullName =
  "Nop.Web.Framework.AbcWebWorkContext"}.</p>
</blockquote>

<p>This is the hierarchy</p>

<p>IWorkContext (interface) &lt; WebWorkContext &lt; AbcWebWorkContext</p>

<p>_workContext is declared as IWorkContext and Autofac generates an instance as AbcWebWorkContext (as shown above)</p>
