Hi All
Kindly assist, is there a way to call a webapi controller from RegisterArea(AreaRegistrationContext context)?
public override void RegisterArea(AreaRegistrationContext context) { var client = new RestClient("url"); var request = new RestRequest("url/api/get/", Method.GET); request.UseDefaultCredentials = true; request.AddHeader("cache-control", "no-cache"); var requestResult = client.Execute<Output>(request); var result = JsonConvert.DeserializeObject<Output>(requestResult.Content); //takes forever and returns null
context.MapRoute( name: "Student", url: "submission/{controller}/{action}/{id}", defaults: new { controller = "Submission", action = "submission", id = UrlParameter.Optional }, namespaces: new string[] { "Staff.Web.Areas.Student.Controllers" } );
}