Example #1
0
 public async Task<IActionResult> OnPostGenre()
 {
     try
     {
         string cs = _config.GetConnectionString("Default");
         if (!fd.GenreDupeCheck(cs, Request.Form["NewGenre.GenreText"].ToString()))
         {
             fd.AddGenre(cs, Request.Form["NewGenre.GenreText"].ToString());
             return RedirectToPage("./Index");
         }
         return RedirectToPage("./Index", new { @redirect = "genredupe", @value = Request.Form["NewGenre.GenreText"].ToString() });
     }
     catch (Exception ex)
     {
         throw new Exception(ex.ToString());
     }
 }