User-1355965324 posted
Hi
I have the following datarepository EmployeeManager class
EmployeeManager.cs
namespace MyProject.GO.WebAPI.Services
{
public class EmployeeManager : IDataRepository<EmployeeModel, long>
{
GoContext ctx;
public EmployeeManager(GoContext c)
{
ctx = c;
}
public IEnumerable<EmployeeModel> GetAll()
{
var employees = ctx.goEmployee.ToList();
return employees;
}
}
}
I want to call the method GetAll() in my reportcontroller class to get all the employee name in a datatable in report controller
using MyProject.GO.WebAPI.Services;
namespace MyProject.GO.UI.Controllers
{
public class ReportController : Controller
{
public IActionResult LeaversOverviewCriteria()
{
// I want to call GetAll() method here to get all the employees into a datatable , Please help
return View();
}
}
}
With Thanks
Pol