using Core_Grid_AjaxHierarchyEditing.Models;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Core_Grid_AjaxHierarchyEditing.Controllers
{
    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            var products = Enumerable.Range(1, 4).Select(i => new ProductModel
            {
                ProductID = i,
                ProductName = "Special Product"+i
            });
            ViewData["Products"] = products;
            return View();
        }

        public IActionResult About()
        {
            ViewData["Message"] = "Your application description page.";

            return View();
        }

        public IActionResult Contact()
        {
            ViewData["Message"] = "Your contact page.";

            return View();
        }

        public IActionResult Error()
        {
            return View();
        }
    }
}
