public ActionResult Create(StaffVM model) { //Creating a Company object from the CompanyVM Staff staff = new Staff(); staff.FName = model.FName; staff.LName = model.LName; staff.StaffNumber = model.StaffNumber; staff.TypeOfShift = model.TypeOfShift; staff.Address = model.Address; staff.PhoneNumber = model.PhoneNumber; staff.DateOfBirth = model.DateOfBirth; staff.Gender = model.Gender; staff.Insurance = model.Insurance; staff.ContractId = model.ContractId; staff.PositionId = model.PositionId; staff.WardId = model.WardId; //Create a CompanyRepo for saving StaffRepository staffRepository = new StaffRepository(); staffRepository.SaveStaffMember(staff); return(RedirectToAction("Index")); }