コード例 #1
0
        public ActionResult Details(int id)
        {
            EmployeeContext employeeContext = new EmployeeContext();
            Employee employee = employeeContext.Employees.Single(x => x.EmployeeId == id);

            return View(employee);
        }
コード例 #2
0
        //
        // GET: /Department/

        public ActionResult Index()
        {
            EmployeeContext employeeContext = new EmployeeContext();
            List<Department> departments = employeeContext.Departments.ToList();
            return View(departments);
        }
コード例 #3
0
 public ActionResult Index(int departmentId)
 {
     EmployeeContext employeeContext = new EmployeeContext();
     List<Employee> employees = employeeContext.Employees.Where(emp => emp.DepartmentId == departmentId).ToList();
     return View(employees);
 }