Example #1
0
        public List <RssChannelSubscriptionWithStatisticsData> LoadAllChannelsWithStatistics()
        {
            var f =
                from channel in this.database.RssChannels
                join subscription in this.database.RssChannelsSubscriptions
                on channel.Id equals subscription.RssChannelId into RCS
                join entries in this.database.RssEntries
                on channel.Id equals entries.RssChannelId into RE
                select
                new RssChannelSubscriptionWithStatisticsData
            {
                Id    = channel.Id,
                Title = channel.Title,
                SubscriptionsCount = RCS.Count(),
                RssEntriesCount    = RE.Count(),
                Created            = channel.Created,
                Updated            = channel.Updated
            };

            return(f.Distinct().ToList());
        }