Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var take = options.count > 0 ? options.count : 12;
- var page = options.page > 0 ? options.page : 1;
- var skip = take * (page - 1);
- var analysis = _DBContext.Analysis
- .Select(a => new
- {
- comment_count = _DBContext.Comments.Count(c => c.AnalysisID == a.AnalysisID),
- created_at = a.CreatedAt,
- description = a.Description,
- game = new
- {
- patch = a.Game.Patch.Version,
- title = a.Game.Title
- },
- id = a.AnalysisID,
- matchup = new
- {
- players = a.Matchup.Players.Select(p => new
- {
- name = p.Character.Name
- })
- },
- reward = a.RewardID.HasValue ?
- new
- {
- user_id = a.Reward.UserID
- } : null,
- title = a.Title,
- updated_at = a.UpdatedAt,
- user = a.User
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement