예제 #1
0
        public new IQueryable <GeneralNotificationViewModel> Select(IQueryable <Notification> source)
        {
            NotificationViewModel notificationViewModel = base.Select(source).SingleOrDefault();

            return(source.Select(x => new GeneralNotificationViewModel
            {
                Name = notificationViewModel.Name,
                CustomerText = notificationViewModel.CustomerText,
                Notes = notificationViewModel.Notes,
                ProductId = x.Product.Id,
                ProductName = x.Product.Name,
                ProductThumbnail = x.Product.Media.Url,
                VendorId = x.Product.VendorId,
                Hoplink = x.Product.Hoplink,
                Type = x.Type
            }));
        }
        public new IQueryable <MessageNotificationViewModel> Select(IQueryable <Notification> source)
        {
            NotificationViewModel notificationViewModel = base.Select(source).SingleOrDefault();

            return(source.Select(x => new MessageNotificationViewModel
            {
                Type = notificationViewModel.Type,
                Name = notificationViewModel.Name,
                CustomerText = notificationViewModel.CustomerText,
                Notes = notificationViewModel.Notes,
                MessengerName = x.NotificationText
                                .Where(z => z.NotificationId == x.Id && z.Type == 0)
                                .Select(z => z.Name).SingleOrDefault(),
                Email = x.NotificationText
                        .Where(z => z.NotificationId == x.Id && z.Type == 0)
                        .Select(z => z.Email).SingleOrDefault()
            }));
        }