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

namespace KendoUIMVC5.Controllers
{
    public class HomeController : Controller
    {

        public ActionResult Index()
        {
            return View();
        }



        public ActionResult GetDates([DataSourceRequest] DataSourceRequest request)
        {

            List<DateViewModel> result = new List<DateViewModel>();
            for (int i = 0; i < 20; i++)
            {
                result.Add(new DateViewModel {CreatedDate = DateTime.Now.AddDays(-i)});
            }



            return Json(result.ToDataSourceResult(request), JsonRequestBehavior.AllowGet);
        }

        
    }
}


