for (DateTime i = beforedate; i >= beforedate && i <= enddate; i = i.AddDays(1))
{
var list = (from a in context.account
where a.deviceid == deviceid && EntityFunctions.DiffDays(a.tradetime, i) == 0
select a).ToList();
countList.Add(list.Count());
}