// GET: Employee public ActionResult Index() { using (var context = new MySimpleDbContext()) { context.Employees.Remove(context.Employees.Find(Guid.Empty)); Employee employeeObj = new Employee(); employeeObj.ID = Guid.NewGuid(); employeeObj.FirstName = "Nibir"; employeeObj.LastName = "Bhuiyan"; employeeObj.JoiningData = DateTime.Now; context.Employees.Add(employeeObj); context.SaveChanges(); } return View(); }
// GET: Enrollments public ActionResult Index() { using (var context = new MySimpleDbContext()) { Enrollment enrollmentObj = new Enrollment(); enrollmentObj.Band = 1; context.Enrollments.ToList<IEnrollment>(); return View(); } }