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() };
精彩评论