Exemplo n.º 1
0
        private static void RamiInsertNinjaPlayerCode()
        {
            PlayerNinja Ramesh = new PlayerNinja();

            Ramesh.DateOfBirth = DateTime.Today;
            Ramesh.Name        = "Ramesh Vanamu";
            Ramesh.InOlymphics = true;
            Ramesh.StateClanId = 1;

            PlayerNinjaContext ninjaPlayerConext = new PlayerNinjaContext();

            ninjaPlayerConext.PlayerNinjas.Add(Ramesh);
            ninjaPlayerConext.SaveChanges();
        }
Exemplo n.º 2
0
        private static void InsertNinjaPlayer()
        {
            var NinjaPlayer = new PlayerNinja
            {
                Name        = "Ramesh",
                InOlymphics = true,
                DateOfBirth = new DateTime(1981, 6, 22),
                StateClanId = 1
            };

            using (var playerNinjaConext = new PlayerNinjaContext())
            {
                playerNinjaConext.Database.Log = Console.Write;
                playerNinjaConext.PlayerNinjas.Add(NinjaPlayer);
                playerNinjaConext.SaveChanges();
            }
        }