开发者

Help with a LINQ Query

I need some help developing a two linq querys. this is my table:

Id              int 
ComputadorID    int 
UtilID          int 
UtilizadorId    int 
DataInicio      datetime    
DataFim         datetime    
Removido        bit 

wh开发者_StackOverflow社区at i want to do is getting a two list: First list gets the count by hours; Second list gets the count by day;

in the two list only count when datafim is inserted how can i do it?


Assuming DataInicio is your colum that has the days and hours you could try something like this

var result = from d in yourContextVar.YourTable
group d by d.DataInicio.Day into g
select new { Day=g.Key, Count=g.Count() };
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜