public IActionResult Create() { var categories = this.categoriesService.GetAllCategories <CategoriesDropDownModel>(); var viewModel = new GamesCreateInputModel { Categories = categories, }; return(this.View(viewModel)); }
public async Task <IActionResult> Create(GamesCreateInputModel input) { if (!this.ModelState.IsValid) { return(this.View(input)); } await this.gamesService.CreateAsync(input.Title, input.PictureUrl, input.ReleaseDate, input.CompanyName, input.Description, input.CategoryId); return(this.Redirect("/Games/All")); }