Example #1
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)));
 }
Example #2
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()));
 }
Example #3
0
 private CourseApi(Guid id,
                   string name,
                   string description,
                   AuthorApi author,
                   IEnumerable <VideoApi> videos)
 {
     Id          = id;
     Name        = name;
     Description = description;
     Author      = author;
     Videos      = videos;
 }
Example #4
0
 public static Author ToDomain(AuthorApi author)
 {
     return(Author.Create(author.Id, author.Name, author.ImageUrl));
 }