Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. var take = options.count > 0 ? options.count : 12;
  2. var page = options.page > 0 ? options.page : 1;
  3. var skip = take * (page - 1);
  4. var analysis = _DBContext.Analysis
  5. .Select(a => new
  6. {
  7. comment_count = _DBContext.Comments.Count(c => c.AnalysisID == a.AnalysisID),
  8. created_at = a.CreatedAt,
  9. description = a.Description,
  10. game = new
  11. {
  12. patch = a.Game.Patch.Version,
  13. title = a.Game.Title
  14. },
  15. id = a.AnalysisID,
  16. matchup = new
  17. {
  18. players = a.Matchup.Players.Select(p => new
  19. {
  20. name = p.Character.Name
  21. })
  22. },
  23. reward = a.RewardID.HasValue ?
  24. new
  25. {
  26. user_id = a.Reward.UserID
  27. } : null,
  28. title = a.Title,
  29. updated_at = a.UpdatedAt,
  30. user = a.User
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement