Override

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
 
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

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

Thanks,
Miguel
 
A

Arne Vajhøj

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


Top