public static StudentInSubscriptionDTO ConvertToDTO(StudentInSubscription studentInSubscription) { StudentInSubscriptionDTO studentInSubscriptionDTO = new StudentInSubscriptionDTO(); studentInSubscriptionDTO.Id = studentInSubscription.Id; studentInSubscriptionDTO.StudentId = studentInSubscription.StudentId; studentInSubscriptionDTO.SubscribtionId = studentInSubscription.SubscribtionId; studentInSubscriptionDTO.StartDate = studentInSubscription.StartDate; studentInSubscriptionDTO.FinishDate = studentInSubscription.FinishDate; return(studentInSubscriptionDTO); }
public static StudentInSubscription ConvertFromDTO(StudentInSubscriptionDTO studentInSubscriptionDTO) { StudentInSubscription studentInSubscription = new StudentInSubscription(); if (studentInSubscriptionDTO.Id != default) { studentInSubscription.Id = studentInSubscriptionDTO.Id; } studentInSubscription.StudentId = studentInSubscriptionDTO.StudentId; studentInSubscription.SubscribtionId = studentInSubscriptionDTO.SubscribtionId; studentInSubscription.StartDate = Convert.ToDateTime(studentInSubscriptionDTO.StartDate); studentInSubscription.FinishDate = Convert.ToDateTime(studentInSubscriptionDTO.FinishDate); studentInSubscription.Stop = studentInSubscriptionDTO.Stop; return(studentInSubscription); }