public new IQueryable <ProductMediaNotificationViewModel> Select(IQueryable <Notification> source)
        {
            GeneralNotificationViewModel generalNotificationViewModel = base.Select(source).SingleOrDefault();

            return(source.Select(x => new ProductMediaNotificationViewModel
            {
                Name = generalNotificationViewModel.Name,
                CustomerText = generalNotificationViewModel.CustomerText,
                Notes = generalNotificationViewModel.Notes,
                ProductId = generalNotificationViewModel.ProductId,
                ProductName = generalNotificationViewModel.ProductName,
                ProductThumbnail = generalNotificationViewModel.ProductThumbnail,
                VendorId = generalNotificationViewModel.VendorId,
                Hoplink = generalNotificationViewModel.Hoplink,
                Media = x.Product.ProductMedia.Select(m => new MediaViewModel
                {
                    Id = m.Media.Id,
                    Name = m.Media.Name,
                    Url = m.Media.Url,
                    Thumbnail = m.Media.Thumbnail,
                    Type = m.Media.Type
                }),
                Type = x.Type
            }));
        }
Exemplo n.º 2
0
        public new IQueryable <ProductDescriptionNotificationViewModel> Select(IQueryable <Notification> source)
        {
            GeneralNotificationViewModel generalNotificationViewModel = base.Select(source).SingleOrDefault();

            return(source.Select(x => new ProductDescriptionNotificationViewModel
            {
                Name = generalNotificationViewModel.Name,
                CustomerText = generalNotificationViewModel.CustomerText,
                Notes = generalNotificationViewModel.Notes,
                ProductId = generalNotificationViewModel.ProductId,
                ProductName = generalNotificationViewModel.ProductName,
                ProductThumbnail = generalNotificationViewModel.ProductThumbnail,
                VendorId = generalNotificationViewModel.VendorId,
                Hoplink = generalNotificationViewModel.Hoplink,
                ProductDescription = x.Product.Description,
                Type = x.Type
            }));
        }
Exemplo n.º 3
0
        public new IQueryable <ProductContentNotificationViewModel> Select(IQueryable <Notification> source)
        {
            GeneralNotificationViewModel generalNotificationViewModel = base.Select(source).SingleOrDefault();

            return(source.Select(x => new ProductContentNotificationViewModel
            {
                Name = generalNotificationViewModel.Name,
                CustomerText = generalNotificationViewModel.CustomerText,
                Notes = generalNotificationViewModel.Notes,
                ProductId = generalNotificationViewModel.ProductId,
                ProductName = generalNotificationViewModel.ProductName,
                ProductThumbnail = generalNotificationViewModel.ProductThumbnail,
                VendorId = generalNotificationViewModel.VendorId,
                Hoplink = generalNotificationViewModel.Hoplink,
                MinPrice = x.Product.MinPrice,
                MaxPrice = x.Product.MaxPrice,
                Content = x.Product.ProductContent.Select(c => new ProductContentViewModel
                {
                    Id = c.Id,
                    Name = c.Name,
                    Icon = new ImageViewModel
                    {
                        Id = c.Media.Id,
                        Name = c.Media.Name,
                        Url = c.Media.Url
                    },
                    PriceIndices = c.Product.ProductPricePoints.OrderBy(y => y.Index).Select(z => c.PriceIndices.Select(w => w.Index).Contains(z.Index))
                }),
                PricePoints = x.Product.ProductPricePoints.OrderBy(y => y.Index).Select(p => new ProductPricePointViewModel
                {
                    Id = p.Id,
                    TextBefore = p.TextBefore,
                    WholeNumber = p.WholeNumber,
                    Decimal = p.Decimal,
                    TextAfter = p.TextAfter
                }),
                Type = x.Type
            }));
        }
        public new IQueryable <ReviewComplaintNotificationViewModel> Select(IQueryable <Notification> source)
        {
            GeneralNotificationViewModel generalNotificationViewModel = base.Select(source).SingleOrDefault();

            return(source.Select(x => new ReviewComplaintNotificationViewModel
            {
                Name = generalNotificationViewModel.Name,
                CustomerText = generalNotificationViewModel.CustomerText,
                Notes = generalNotificationViewModel.Notes,
                ProductId = generalNotificationViewModel.ProductId,
                ProductName = generalNotificationViewModel.ProductName,
                ProductThumbnail = generalNotificationViewModel.ProductThumbnail,
                VendorId = generalNotificationViewModel.VendorId,
                Hoplink = generalNotificationViewModel.Hoplink,
                Type = x.Type,
                Review = x.NotificationText.Select(y => new NotificationTextViewModel
                {
                    ReviewId = y.ProductReview.Id,
                    TimeStamp = y.ProductReview.Date.ToString("MMMM dd, yyyy hh:mm tt"),
                    Thumbnail = y.ProductReview.Customer.Image,
                    Text = y.ProductReview.Text
                }).SingleOrDefault()
            }));
        }