public EntityStateWrapperContainer Modify(ContosoUniversity.Domain.Core.Behaviours.Students.StudentModify.CommandModel commandModel)
        {
            EnrollmentDate = commandModel.EnrollmentDate;
            FirstMidName = commandModel.FirstMidName;
            LastName = commandModel.LastName;

            return new EntityStateWrapperContainer().ModifyEntity(this);
        }
        public EntityStateWrapperContainer Modify(ContosoUniversity.Domain.Core.Behaviours.Departments.DepartmentUpdate.CommandModel commandModel)
        {
            DepartmentID = commandModel.DepartmentID;
            Budget = commandModel.Budget;
            InstructorID = commandModel.InstructorID;
            Name = commandModel.Name;
            RowVersion = commandModel.RowVersion;
            StartDate = commandModel.StartDate;

            return new EntityStateWrapperContainer().ModifyEntity(this);
        }
        public static EntityStateWrapperContainer Create(ContosoUniversity.Domain.Core.Behaviours.Departments.DepartmentCreate.CommandModel commandModel)
        {
            var dept = new Department
            {
                Budget = commandModel.Budget,
                InstructorID = commandModel.InstructorID,
                Name = commandModel.Name,
                StartDate = commandModel.StartDate,
            };

            return new EntityStateWrapperContainer().AddEntity(dept);
        }
        public EntityStateWrapperContainer Modify(IQueryRepository queryRepository, ContosoUniversity.Domain.Core.Behaviours.Instructors.InstructorModifyAndCourses.CommandModel commandModel)
        {
            var retVal = new EntityStateWrapperContainer();

            // Removals first
            Courses.Clear();
            if (OfficeAssignment != null && commandModel.OfficeLocation == null)
                retVal.DeleteEntity(OfficeAssignment);

            // Update properties
            FirstMidName = commandModel.FirstMidName;
            LastName = commandModel.LastName;
            HireDate = commandModel.HireDate;
            OfficeAssignment = new OfficeAssignment { Location = commandModel.OfficeLocation };

            if (commandModel.SelectedCourses != null)
            {
                Courses = queryRepository.GetEntities<Course>(
                    new FindByIdsSpecificationStrategy<Course>(p => p.CourseID, commandModel.SelectedCourses)).ToList();
            }

            retVal.ModifyEntity(this);
            return retVal;
        }