Recently I have updated MVC to 5.1. I am getting exception
Cannot call action method 'Void MyAd(Inspinia_MVC5_SeedProject.Models.Ad ByRef, System.String, System.String, System.String)' on controller 'Inspinia_MVC5_SeedProject.CodeTemplates.ElectronicsController' because the parameter 'Inspinia_MVC5_SeedProject.Models.Ad& ad' is passed by reference.
on routes.MapMvcAttributeRoutes();
MyAd function is:
public void MyAd(ref Ad ad,string SaveOrUpdate,string cateogry = null,string subcategory = null)
{
var type = System.Web.HttpContext.Current.Request["type"];
var isbiding = System.Web.HttpContext.Current.Request["bidingAllowed"];
var condition = System.Web.HttpContext.Current.Request["condition"];
var pp = System.Web.HttpContext.Current.Request["price"];
//other huge stuff.
}
I am using this function in different controllers.
I call the function to save data in ad object
MyAd(ref ad,"Save","Electronics","HomeAppliances");
and then I use data as ad.type.
How can I tackle this exception?