using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;
using SortWithSwitch.Models;

namespace SortWithSwitch.Controllers
{
    public partial class GridController : Controller
    {
        public ActionResult Orders_Read([DataSourceRequest] DataSourceRequest request, bool isCheck)
        {
            var result = Enumerable.Range(0, 50).Select(i => new EmployeeViewModel
            {
                Id = i,
                IsActive = true ? i % 2 == 0 : false

            }).Where(x=>x.IsActive == isCheck);

            return Json(result.ToDataSourceResult(request));
        }
    }
}
