using Kendo.Mvc.Extensions;
using Kendo.Mvc.UI;

using KendoNull.Models;

using Microsoft.AspNetCore.Mvc;

namespace KendoNull.Controllers;

public class HomeController : Controller
{
    private static readonly IList<InfoModel> colors = new[]
    {
        new InfoModel{ColorName="Aquamarine"},
        new InfoModel{ColorName="Turquoise"},
        new InfoModel{ColorName="Periwinkle"},
    };

    public IActionResult Index() => View();

    public IActionResult Grid() => View();

    public IActionResult List([DataSourceRequest] DataSourceRequest request) =>
        Json(colors.ToDataSourceResult(request));
}
