コード例 #1
0
        public IActionResult AddPerso(string name, string firstname)
        {
            ViewBag.NbreVisitUnique = GetVisitIP();
            ViewBag.NbrePagesVues   = GetPageVues();


            UserConnect(ViewBag);
            ConsentCookie(ViewBag);

            List <PrenomPerso> Prenoms = new List <PrenomPerso>();

            PrenomPerso prenomPerso = new PrenomPerso {
                Prenom = firstname
            };

            Prenoms.Add(prenomPerso);

            Personnage p = new Personnage {
                Nom = name, Prenoms = Prenoms
            };

            p = p.AddNewPerso();

            return(View("AddPersos", p));
        }