I receive the following exception when trying to login in:
The current request for action 'Login' on controller type 'AccountController' is ambiguous between the following action methods:
System.Web.Mvc.ActionResult Login() on type Sandbox.Web.Controllers.AccountController
System.Web.Mvc.ActionResult Login(Sandbox.Web.Models.Account.LoginModel) on type Sandbox.Web.Controllers.AccountController
Well I know that what it means, but I don't get why I receive it (only) at login. My login code has been built like all my other actions
public class AccountController : Controller
{
// ctor...
[AllowAnonymous]
public ActionResult Login()
{
// ...
}
[AllowAnonymous]
[HttpPost]
public ActionResult Login(LoginModel model)
{
// ...
}
}
My other actions are built like
ActionResult Create()
[HttpPost]
ActionResult Create(OrderModel model)
ActionResult Edit(int id)
[HttpPost]
ActionResult Edit(OrderModel model)
and they work without problems.
I am using Autofac 4.9 with Autofac.Integration.Mvc (4.0) within a MVC 5.2.7 application. The only part I changed from default MVC template is the dependency resolver
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
If I place a [HttpGet]
before Login()
everything works well.
Anyone having an idea on how to get this working or why it does not work?