Recently i installed Fluent
I have two projects - one MVC and other Web Api project. Both have same controller named as Deals controller. After fluent installation, i got problem that web api request is not able to locate any DealsController.
In MVC's Gloabal asax- Application_Start method:
protected void Application_Start(object sender, EventArgs e)
{
System.Web.Http.GlobalConfiguration.Configure(CompanyName.Service.WebApiConfig.Register);
CompanyName.RouteConfig.RegisterRoutes(System.Web.Routing.RouteTable.Routes);
}
Both these statements registers the routes for mvc and web api respectively.
I have DealsController, which is located with the same name in both the projects (MVC and Web Api).
This is MVC's DealsController:
public class DealsController : System.Web.Mvc.Controller
{
public DealsController()
{
}
}
This is Web Apis Deals controller:
public class DealsController : System.Web.Http.ApiController
{
public DealsController()
{
}
[Route("api/advantage/getDeals/")]
public IHttpActionResult GetDeals([FromUri] CompanyName.Entity.Deals.Filters filter)
{
}
}
Post fluentvalidation.webapi installation from nuget, when i am hitting this web api's method: http://localhost/api/advantage/getDeals/?cityId=2&sc=0&so=1&pn=1
I am getting following error:
"Message": "No HTTP resource was found that matches the request URI 'http://localhost/api/advantage/getDeals/?cityId=2&sc=0&so=1&pn=1'.",
"MessageDetail": "No type was found that matches the controller named 'advantage'."
I dont know what exactly is happening post installation of fluent validation web api package. I just installed fluentvalidation.webapi package which gave me some cors related error, so i further installed Microsoft.AspNet.WebApi.Cors.
If i am renaming My web api controller (dealscontroller) to some other name, it is working fine.
But i don't understand what is exactly happening here and what other risk this update of fluentvalidation.webapi can have in my solution and other apis.