In .net core, is it not possible to use mvc routing? I used this:
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Landing}/{action=Index}/{id?}");
});
and my action:
public IActionResult Index(string profileId)
{
this.ProfileId = profileId;
return View();
}
but if I used url something like /Profile/index?profileId=1
it works fine but if I use /Profile/index/1
the action is not works. means profileId
is null. Why that happens with me - is there anything I am missing?
I try to use [FromQuery]
and [FromRoute]
in index method but that is not also working.