public static CourseApi FromDomain(Course course) { return(new CourseApi( course.Id, course.CourseName.Name, course.CourseDescription.Description, AuthorApi.FromDomain(course.Author), VideoApi.FromDomain(course.Videos))); }
public static IEnumerable <VideoApi> FromDomain(IEnumerable <Video> videos) { var list = new List <VideoApi>(); foreach (var video in videos) { list.Add(VideoApi.FromDomain(video)); } return(list); }