// GET api/<controller> public List<Department> Get() { List<Department> deptcoll = null; using (EmpMgmtSvc.EmployeeMgmtServiceClient svc = new EmpMgmtSvc.EmployeeMgmtServiceClient()) { deptcoll = svc.GetAllDepartments(); } return deptcoll; }
// // GET: /Department/ public ActionResult Index() { List<Department> deptColl; using (EmpMgmtSvc.EmployeeMgmtServiceClient svc = new EmpMgmtSvc.EmployeeMgmtServiceClient()) { deptColl = svc.GetAllDepartments(); } return View(deptColl); }