Ejemplo n.º 1
0
 public async Task<IActionResult> Create([Bind("Id,Prenom,nom,telephone,mail,note,departement,date_naissance")] Personne personne)
 {
     if (ModelState.IsValid)
     {
         _context.Add(personne);
         await _context.SaveChangesAsync();
         return RedirectToAction(nameof(Index));
     }
     return View(personne);
 }
        public async Task <IActionResult> Create([Bind("ID,Name,URl")] Lien lien)
        {
            if (ModelState.IsValid)
            {
                _context.Add(lien);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(lien));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("ID,Value")] MotClef motClef)
        {
            if (ModelState.IsValid)
            {
                _context.Add(motClef);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(motClef));
        }
        public async Task <IActionResult> Create([Bind("ID,Name,MinDuration,OurDuration,MaxDuration,MinAge,MinPlayer,BestNumberPlayer,Maxplayer,Editeur")] Game game)
        {
            if (ModelState.IsValid)
            {
                _context.Add(game);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(game));
        }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create([Bind("ID,Name")] Proprietaire proprietaire)
        {
            if (ModelState.IsValid)
            {
                _context.Add(proprietaire);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(proprietaire));
        }