Reputation: 941
So I have this code
@if (Model.Products != null)
{
@Html.Raw(string.Join(", ", Model.Products.Select(s => string.Format("<span>{0}</span>", s.Name))))
}
else
{
<text>N/A</text>
}
Which prints a list of products separated by a comma, but the problem is that the Model.Products is never null, it can contain cero products but its never null, is there another way to compare this If statement?
Upvotes: 1
Views: 226