示例#1
0
        private async Task PrepareView()
        {
            this.gameForm = new GameFormModel();
            this.gameId = this.Router.GetQueryParam("gameId");
            this.categories = await this.CategoryService.GetCategoryNames();

            if (this.Action.ToLower() == "edit" && !string.IsNullOrWhiteSpace(this.gameId))
            {
                this.gameForm = await this.GameService.GetGame(this.gameId);
            }

            this.StateHasChanged();
        }
示例#2
0
 public async Task EditGame(string gameId, GameFormModel game)
 {
     await this.httpClient.PutAsync <string>(this.gamesUrl + gameId, game);
 }
示例#3
0
 public async Task AddGame(GameFormModel game)
 {
     await this.httpClient.PostAsync <string>(this.gamesUrl, game);
 }
示例#4
0
 protected override async Task OnInitializedAsync()
 {
     this.gameForm = await this.GameService.GetGame(this.GameId);
 }