示例#1
0
        private static void UpdateDetails(Instructor instructor, _.CreateEdit.Command message)
        {
            instructor.FirstMidName = message.FirstMidName;
            instructor.LastName     = message.LastName;
            instructor.HireDate     = message.HireDate.GetValueOrDefault();

            if (string.IsNullOrWhiteSpace(message.OfficeAssignmentLocation))
            {
                instructor.OfficeAssignment = null;
            }
            else if (instructor.OfficeAssignment == null)
            {
                instructor.OfficeAssignment = new OfficeAssignment
                {
                    Location = message.OfficeAssignmentLocation
                };
            }
            else
            {
                instructor.OfficeAssignment.Location = message.OfficeAssignmentLocation;
            }
        }
示例#2
0
        public static void Handle(this Instructor instructor, _.CreateEdit.Command message)
        {
            UpdateDetails(instructor, message);

            UpdateInstructorCourses(instructor, message.Courses);
        }