Exemple #1
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetGameSystemSummaries request)
        {
            var gameSystems = GetAllLibraryItems(request.UserId, _userManager, _libraryManager, null, i => i is GameSystem)
                              .Cast <GameSystem>()
                              .ToList();

            var user = request.UserId == null ? null : _userManager.GetUserById(request.UserId);

            var result = gameSystems
                         .Select(i => GetSummary(i, user))
                         .ToList();

            return(ToOptimizedSerializedResultUsingCache(result));
        }
Exemple #2
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetGameSystemSummaries request)
        {
            var gameSystems = GetAllLibraryItems(request.UserId, _userManager, _libraryManager)
                              .OfType <GameSystem>()
                              .ToList();

            var user = request.UserId == null ? null : _userManager.GetUserById(request.UserId.Value);

            var result = gameSystems
                         .Select(i => GetSummary(i, user))
                         .ToList();

            return(ToOptimizedResult(result));
        }
Exemple #3
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetGameSystemSummaries request)
        {
            var user  = request.UserId == null ? null : _userManager.GetUserById(request.UserId);
            var query = new InternalItemsQuery(user)
            {
                IncludeItemTypes = new[] { typeof(GameSystem).Name }
            };
            var gameSystems = _libraryManager.GetItemList(query)
                              .Cast <GameSystem>()
                              .ToList();

            var result = gameSystems
                         .Select(i => GetSummary(i, user))
                         .ToList();

            return(ToOptimizedSerializedResultUsingCache(result));
        }
Exemple #4
0
        /// <summary>
        /// Gets the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>System.Object.</returns>
        public object Get(GetGameSystemSummaries request)
        {
            var user  = request.UserId == null ? null : _userManager.GetUserById(request.UserId);
            var query = new InternalItemsQuery(user)
            {
                IncludeItemTypes = new[] { typeof(GameSystem).Name },
                DtoOptions       = new DtoOptions(false)
                {
                    EnableImages = false
                }
            };

            var result = _libraryManager.GetItemList(query)
                         .Cast <GameSystem>()
                         .Select(i => GetSummary(i, user))
                         .ToArray();

            return(ToOptimizedResult(result));
        }