Displaying tabular data from database using React.js

In the previous post, I have shown you "Hello World" example using ReactJS in asp.net mvc. Today I am going to show you, how to display tabular data from a database  (list of data) using React.js, ASP.NET MVC and entity framework.
Displaying tabular data from database using React.js
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MVCReactPart2.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public JsonResult GetEmployeeData()
        {
            using (MyDatabaseEntities dc = new MyDatabaseEntities())
            {
                var data = dc.Employees.OrderBy(a => a.FirstName).ToList();
                return new JsonResult { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet };
            }
        }
	}
}
Posted By :