コード例 #1
0
        public async Task <GameViewModel> GetGameViewModelForRegisterAsync()
        {
            UsedGamesAPIPlatformResponse response = await _usedGamesAPIPlatforms.GetPlatformsAsync();

            if (!response.Success)
            {
                return(null);
            }

            GameViewModel viewModel = new GameViewModel
                                      (
                platforms: new SelectList(response.Platforms, "Id", "Name"), imgsPerGame: GetImgsPerGame(), sellerId: _loginManager.GetUserId()
                                      );

            return(viewModel);
        }
コード例 #2
0
        private async Task <UsedGamesAPIPlatformResponse> GetPlatformsAsync(ActionExecutingContext context)
        {
            UsedGamesAPIPlatforms usedGamesAPIPlatforms = (UsedGamesAPIPlatforms)context.HttpContext.RequestServices.GetService(typeof(UsedGamesAPIPlatforms));

            return(await usedGamesAPIPlatforms.GetPlatformsAsync());
        }