Hello All.
I have created on new Index.cshtml file
In that I add @model MiniShoppingCartModel as first line.
Then I call methods as below :
<div class="count">
@if (Model.TotalProducts == 0)
{
@T("ShoppingCart.Mini.NoItems")
}
else
{
@Html.Raw(string.Format(T("ShoppingCart.Mini.ItemsText").Text, $"<a href=\"{Url.RouteUrl("ShoppingCart")}\">{string.Format(T("ShoppingCart.Mini.Items").Text, Model.TotalProducts)}</a>"))
}
</div>
Now when I run my page then getting following error :
+ $exception {"Object reference not set to an instance of an object."} System.NullReferenceException
Any idea how to solve this.
Thanks