public TimeZoneContent(Guid siteID)
{
// use C# libraries for timezones rather than pass in offset as some dates are +/- an hour off because of DST
this.SiteID = siteID;
this.ContentLocalDates = new List <ContentLocalTime>();
this.BlogPostUrls = new List <BlogPostPageUrl>();
SiteData site = SiteData.GetSiteFromCache(siteID);
List <carrot_RootContent> queryAllContent = null;
using (CarrotCMSDataContext db = CarrotCMSDataContext.GetDataContext()) {
queryAllContent = CannedQueries.GetAllRootTbl(db, siteID).ToList();
}
var allContentDates = (from p in queryAllContent
select p.GoLiveDate).Distinct().ToList();
var blogDateList = (from p in queryAllContent
where p.ContentTypeID == ContentPageType.GetIDByType(ContentPageType.PageType.BlogEntry)
select p.GoLiveDate).Distinct().ToList();
this.ContentLocalDates = (from d in allContentDates
select new ContentLocalTime()
{
GoLiveDate = d,
GoLiveDateLocal = site.ConvertUTCToSiteTime(d)
}).ToList();
this.BlogPostUrls = (from bd in blogDateList
join ld in this.ContentLocalDates on bd equals ld.GoLiveDate
select new BlogPostPageUrl()
{
GoLiveDate = ld.GoLiveDate,
PostPrefix = CleanPostPrefix(ContentPageHelper.CreateFileNameFromSlug(siteID, ld.GoLiveDateLocal, string.Empty)),
GoLiveDateLocal = ld.GoLiveDateLocal
}).ToList();
}