mvc how to get the max value from model in view code example Example: cshtml set a max value foreach @foreach (ViewModel variable in Model.Take(value))