Beispiel #1
0
        public async Task <IActionResult> Create([Bind("Id,Libelle,HorsStats,IdTypecategorie")] Categorie categorie)
        {
            if (ModelState.IsValid)
            {
                await _categorieService.AddAsync(categorie);

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdTypecategorie"] = new SelectList(_typeCategorieService.ListAll(), "Id", "Libelle", categorie.IdTypecategorie);
            return(View(categorie));
        }