Answer the question
In order to leave comments, you need to log in
reactjs frontend in asp.net mvc??
How to display data from controller in reactjs using react routing??
public ActionResult Index()
{
var employees = _dataBase.Employees.GetAll();
var employeesVM = new List<EmployeeViewModel>();
foreach(var employee in employees)
{
var employeeVM = _employeeMapper.Map(employee);
employeesVM.Add(employeeVM);
}
return Json(employeesVM, JsonRequestBehavior.AllowGet);
}
Answer the question
In order to leave comments, you need to log in
And what does react routing have to do with it? You need to get JSON from your ASP.NET MVC controller using some http client https://github.com/axios/axios and render them in a view of some of your React component.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question