public static CourseListDTO Entity2CourseListDTO(this USER_CourseListToken entity, string priceDisplayName) { var token = new CourseListDTO { CourseId = entity.Id , Uid = entity.Uid , Name = entity.CourseName , Price = entity.Price , MonthlySubscriptionPrice = entity.MonthlySubscriptionPrice , AuthorId = entity.AuthorUserId , AuthorFullName = entity.Entity2AuthorFullName() , LearnerCount = entity.LearnerCount , ReviewCount = entity.ReviewCount , ImageUrl = entity.SmallImage.ToThumbUrl(Constants.ImageBaseUrl) , AddOn = entity.Created , Status = Utils.ParseEnum <CourseEnums.CourseStatus>(entity.StatusId) , IsFree = entity.IsFreeCourse , IsPurchased = entity.LearnerCount > 0 , PriceDisplayName = priceDisplayName }; token.CoursePageUrl = token.GenerateCoursePageUrl(token.AuthorFullName, token.Name, null); return(token); }
public static CourseListDTO SetCoursePageUrl(this CourseListDTO dto, string trackingId, string mode = null) { var token = dto; token.CoursePageUrl = Extensions.GenerateCoursePageUrl(null, token.AuthorFullName, token.Name, trackingId, mode); return(token); }