// // GET: /HelloWorld/Search/ async public Task <IActionResult> Search(string name) { SearchModel model = new SearchModel(); var success = await model.FillPlayers(name); ViewData["Message"] = model.Players[0].SteamId; ViewData["Name"] = model.Players[0].Name; return(View()); }
// // GET: / async private Task <IActionResult> Search(string name) { SearchModel model = new SearchModel(); if (string.IsNullOrEmpty(name)) { ViewData["Error"] = ""; return(View(model.Players)); } var success = await model.FillPlayers(name); if (success) { ViewData["Message"] = model.Players[0].SteamId; ViewData["Players"] = model.Players; } ViewData["Name"] = name; ViewData["Error"] = model.ErrorText; return(View(model.Players)); }