Skip to content

Instantly share code, notes, and snippets.

@fernandezdavid
Created August 8, 2013 01:25
Show Gist options
  • Save fernandezdavid/6180639 to your computer and use it in GitHub Desktop.
Save fernandezdavid/6180639 to your computer and use it in GitHub Desktop.
foreach (var campDetail in camp.AdvertCampaignDetails)
{
DateTime check_date = DateTime.Now.AddDays(-i);
inter += _db.AdvertCampaignDetailInteractions
.Where(c => c.AdvertID == campDetail.AdvertID && EntityFunctions.TruncateTime(c.StartDatetime) == check_date.Date)
.Count();
elapsedTime += _db.AdvertCampaignDetailInteractions
.Where(c => c.AdvertID == campDetail.AdvertID && EntityFunctions.TruncateTime(c.StartDatetime) == check_date.Date && c.TimeElapsed!=null)
.Sum(c => c.TimeElapsed.GetValueOrDefault(0));
height += _db.AdvertCampaignDetailInteractions
.Where(c => c.AdvertID == campDetail.AdvertID && EntityFunctions.TruncateTime(c.StartDatetime) == check_date.Date)
.Sum(c=>c.Height);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment