Override

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have the following method:

public class DefaultControllerFactory : IControllerFactory {
protected internal virtual IController GetControllerInstance(Type
controllerType) {
}
}

How can I override it? I tried:
public class StructureMapControllerFactory :
DefaultControllerFactory {
protected override IController GetControllerInstance(Type
controllerType) {
}
}

But I get the error:
no suitable method found to override

Thanks,
Miguel
 
Hello,

I have the following method:

public class DefaultControllerFactory : IControllerFactory {
  protected internal virtual IController GetControllerInstance(Type
controllerType) {
  }

}

How can I override it? I tried:
  public class StructureMapControllerFactory :
DefaultControllerFactory {
    protected override IController GetControllerInstance(Type
controllerType) {
    }
  }

But I get the error:
no suitable method found to override

Thanks,
Miguel

Solved!
I was looking at an old version of MSFT code and the method is
different now.

Thanks,
Miguel
 
I have the following method:

public class DefaultControllerFactory : IControllerFactory {
protected internal virtual IController GetControllerInstance(Type
controllerType) {
}
}

How can I override it? I tried:
public class StructureMapControllerFactory :
DefaultControllerFactory {
protected override IController GetControllerInstance(Type
controllerType) {
}
}

But I get the error:
no suitable method found to override

protected != protected internal

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Interface that's not an interface? 2
Override property 18
Question on interfaces and inheritance 7
Inheritance and overriding 9
inheritance 4
Configuration Section 3
"new" vs "override" for a method 3
Generics 7

Back
Top