示例#1
0
 public static Course ToDomain(CourseApi course)
 {
     return(Library.Domain.CourseAggregate.Model.Course.Create(
                course.Id,
                course.Name,
                course.Description,
                AuthorApi.ToDomain(course.Author),
                VideoApi.ToDomain(course.Videos).ToList()));
 }
示例#2
0
 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)));
 }
示例#3
0
        public static IEnumerable <Video> ToDomain(IEnumerable <VideoApi> videos)
        {
            var list = new List <Video>();

            foreach (var video in videos)
            {
                list.Add(VideoApi.ToDomain(video));
            }

            return(list);
        }
示例#4
0
 public static Video ToDomain(VideoApi video)
 {
     return(Library.Domain.CourseAggregate.Model.Video.Create(video.Id, video.Name, video.Url));
 }