I'm using MVC5, and have gotten CaptchaMvc nuget package.
I want to use function IsCaptchaValid
from this package in my controller.
This is the signature of the function
public static bool IsCaptchaValid(this ControllerBase controllerBase, string errorText, params ParameterModel[] parameters);
From here, when I go to definition of ControllerBase
, I get to see that this class is part of System.Web.Mvc
, v5.2.3.0.
When I go to my controller, I see that it inherits from BaseController
(my class), and that this class inherits from AsyncController
class, that is abstract, and also part of System.Web.Mvc
namespace. When I go to definition of this class I see that it inherits from System.Web.Mvc.Controller
, and that this class inherits from System.Web.Mvc.ControllerBase
.
My question is, how is it that I cannot use function IsCaptchaValid
in my controller?
Is it because of the abstract AsyncController
, and if so, why should abstract class hide funcitons?
Is there a way that would allow me to use this function without making my controller inheritance hierarchy?
UPDATE 1:
As Richard Deeming mentioned
I am using CaptchaMvc namespace needed for this function to work, but VS doesn't seem to recognize that I installed it, even though I can clearly see that I did in Nuget Package Manager for this project.
CodePudding user response:
For some reason, I just needed to restart Visual Studio...