コード例 #1
0
        public virtual ApiEventTeacherServerResponseModel MapServerRequestToResponse(
            int id,
            ApiEventTeacherServerRequestModel request)
        {
            var response = new ApiEventTeacherServerResponseModel();

            response.SetProperties(id,
                                   request.EventId,
                                   request.TeacherId);
            return(response);
        }
コード例 #2
0
        public virtual ApiEventTeacherServerResponseModel MapEntityToModel(
            EventTeacher item)
        {
            var model = new ApiEventTeacherServerResponseModel();

            model.SetProperties(item.Id,
                                item.EventId,
                                item.TeacherId);
            if (item.EventIdNavigation != null)
            {
                var eventIdModel = new ApiEventServerResponseModel();
                eventIdModel.SetProperties(
                    item.EventIdNavigation.Id,
                    item.EventIdNavigation.ActualEndDate,
                    item.EventIdNavigation.ActualStartDate,
                    item.EventIdNavigation.BillAmount,
                    item.EventIdNavigation.EventStatusId,
                    item.EventIdNavigation.ScheduledEndDate,
                    item.EventIdNavigation.ScheduledStartDate,
                    item.EventIdNavigation.StudentNotes,
                    item.EventIdNavigation.TeacherNotes);

                model.SetEventIdNavigation(eventIdModel);
            }

            if (item.TeacherIdNavigation != null)
            {
                var teacherIdModel = new ApiTeacherServerResponseModel();
                teacherIdModel.SetProperties(
                    item.TeacherIdNavigation.Id,
                    item.TeacherIdNavigation.Birthday,
                    item.TeacherIdNavigation.Email,
                    item.TeacherIdNavigation.FirstName,
                    item.TeacherIdNavigation.LastName,
                    item.TeacherIdNavigation.Phone,
                    item.TeacherIdNavigation.UserId);

                model.SetTeacherIdNavigation(teacherIdModel);
            }

            return(model);
        }