public IActionResult OnPostCreate(string name, string description) { CollectionRepository collectionRepository = new CollectionRepository(); try { collectionRepository.Create(new Models.Collection(-1, name, description)); return(RedirectToPage("./Index")); } catch (Exception) { Message = "The try to add new collection was incorrect!"; IsWarningMessage = true; } return(RedirectToPage()); }