I cannot figure out how to do "nested" operation in Razor. For example how to use IF inside FOREACH. VisualStudio throws compile-time error on following block, saying "Invalid expression term 'if' "
@foreach (var document in Model) {
@if (document.Item.Count > 0) {
<div>
@MvcHtmlString.Create(document.Items[0].ContentPresenter)
</div>
}
}