daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest May 16th, 2018 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var event2 = (
  2. from e in Tb_Events
  3. where e.EventID == 10010
  4. group e by new { e.EventID } into menge
  5. select new { menge.Key.EventID,dtStart = menge.Min(m => m.TimeGenerated),dtEnd = menge.Max(m=>m.TimeGenerated) }
  6. );
  7.  
  8.  
  9. var Total = (from e in Tb_Events
  10. where e.EventID == 10010
  11. group e by new {e.EventID,e.TimeGenerated.Value.Year,e.TimeGenerated.Value.Month} into gesamt
  12. select new {jahr = gesamt.Key.Year,monat = gesamt.Key.Month, total = gesamt.Count()});
  13.  
  14. //Total.Dump();
  15.  
  16.  
  17. var kal = (from c in Calendars
  18. group c by new {c.Year,c.Month} into dates
  19. orderby dates.Key.Year,dates.Key.Month
  20. select new {dates.Key.Year,dates.Key.Month});
  21.  
  22. (from k in kal
  23. //join t in Total on new { k.Year,k.Month} equals new {t.jahr,t.monat}
  24. join t in Total on new {k.Year} equals new {t.jahr}
  25. select k).Dump();
  26. //from t in t2.DefaultIfEmpty()
  27. //select new {
  28. //  t.jahr,
  29. //  t.monat,
  30. //  Total = t == null ? 0 : t.total
  31. //}).Dump();
RAW Paste Data
Top