cshtml set a max value foreach code example Example: cshtml set a max value foreach @foreach (ViewModel variable in Model.Take(value))