I have a Product.Core MVC project. This project has some common API controllers.
I have another MVC project "Product" that references Product.Core.
The API controllers work as expected. I can call APIs defined in both solutions.
I now want to extended one of the API controllers in Product.Core. Say XXXApiController.
I have the same controller defined in the Product project.
namespace Product
{
public class XXXApiController : Product.Core.XXXApiController
{
public new Task<XXXResponse> MyApiAsync()
{
var response = await base.MyApiAsync();
// do extra code here
return response;
}
}
}
However, after this change it seems the XXXApiController is no longer available. I get a 'No HTTP resource was found' error.
How can I extend an API controller that lives in another MVC project?