SaaS CMS has officially launched! Learn more now.

Null exception in commerce controller

Vote:
 

I am trying to create controller fro commerce as explained in the link below. However, I am getting NULL exception in the parameter of action. e.g. 

currentContent is null in
public class AlloyCategoryController : ContentControllerBase<AlloyNode>
{
    public ActionResult Index(AlloyNode currentContent)
    {
        var model = PageViewModel.Create<AlloyNode>(currentContent);
 
        return View(model);
    }
 
}

https://world.episerver.com/blogs/sorby/dates/2017/9/add-commerce-to-an-alloy-web-site/

#200990
Feb 01, 2019 3:28
Vote:
 

I'd recommend reading https://world.episerver.com/documentation/developer-guides/commerce/getting-started/creating-a-start-page/ which is the offical docs rather than a 2 year old blog post. Do you have the commerce routing set up?

https://world.episerver.com/documentation/developer-guides/commerce/routing/

#201022
Feb 01, 2019 15:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.