public virtual ApiEventStudentServerResponseModel MapServerRequestToResponse( int id, ApiEventStudentServerRequestModel request) { var response = new ApiEventStudentServerResponseModel(); response.SetProperties(id, request.EventId, request.StudentId); return(response); }
public virtual ApiEventStudentServerResponseModel MapEntityToModel( EventStudent item) { var model = new ApiEventStudentServerResponseModel(); model.SetProperties(item.Id, item.EventId, item.StudentId); 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.StudentIdNavigation != null) { var studentIdModel = new ApiStudentServerResponseModel(); studentIdModel.SetProperties( item.StudentIdNavigation.Id, item.StudentIdNavigation.Birthday, item.StudentIdNavigation.Email, item.StudentIdNavigation.EmailRemindersEnabled, item.StudentIdNavigation.FamilyId, item.StudentIdNavigation.FirstName, item.StudentIdNavigation.IsAdult, item.StudentIdNavigation.LastName, item.StudentIdNavigation.Phone, item.StudentIdNavigation.SmsRemindersEnabled, item.StudentIdNavigation.UserId); model.SetStudentIdNavigation(studentIdModel); } return(model); }