Exemple #1
0
        public async Task <IActionResult> Create([Bind("CuiName", "Descript")] Cuisin cuisin)
        {
            if (ModelState.IsValid)
            {
                db.Add(cuisin);
                await db.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cuisin));
        }
Exemple #2
0
        public Cuisin get(string id)
        {
            Cuisin cuisin = db.Cuisin.Where(c => c.CuiName == id).FirstOrDefault();

            return(cuisin);
        }