public static CourseListDTO Entity2CourseListDTO(this LRNR_ItemToken entity, decimal?price, decimal?monthlySubscriptionPrice) { return(new CourseListDTO { CourseId = entity.Id , Uid = entity.Uid , Name = entity.CourseName , Price = price , MonthlySubscriptionPrice = monthlySubscriptionPrice , AuthorId = entity.AuthorUserId , AuthorFullName = entity.Entity2AuthorFullName() , LearnerCount = entity.NumSubscribers , ReviewCount = entity.ReviewCount , ImageUrl = entity.SmallImage.ToThumbUrl(Constants.ImageBaseUrl) , AddOn = entity.Created }); }
public static WidgetItemListDTO Entity2WidgetItemListDto(this LRNR_ItemToken entity, bool isItemOwner, List <PriceLineDTO> itemPrices) { return(new WidgetItemListDTO { ItemID = entity.Id , ItemName = entity.CourseName , ItemType = BillingEnums.ePurchaseItemTypes.COURSE , AuthorName = entity.Entity2AuthorFullName() , AuthorID = entity.AuthorUserId , ImageURL = entity.SmallImage.ToThumbUrl(Constants.ImageBaseUrl) , NumSubscribers = entity.NumSubscribers , Rating = entity.Rating , IsFree = entity.IsFreeCourse , ItemUrlName = entity.CourseUrlName , IsItemOwner = isItemOwner , CoursesCnt = 1 , ItemPrices = itemPrices }); }
public static string Entity2AuthorFullName(this LRNR_ItemToken entity) { return(CombineFullName(entity.AuthorFirstName, entity.AuthorLastName, entity.AuthorNickname)); }