Ejemplo n.º 1
0
        private static void SeedData(TournamentContext context)
        {
            var t1 = new Tournament()
            {
                Id        = Guid.NewGuid(),
                Name      = "Test-Tournament",
                StartDate = DateTime.Now.Date,
                EndDate   = DateTime.Now.Date.AddDays(3),
            };

            var p1 = new Player()
            {
                Id           = Guid.NewGuid(),
                Name         = "Player 1",
                Firstname    = "Player",
                Lastname     = "One",
                TournamentId = t1.Id
            };

            var p2 = new Player()
            {
                Id           = Guid.NewGuid(),
                Name         = "Player 2",
                Firstname    = "Player",
                Lastname     = "Two",
                TournamentId = t1.Id
            };

            context.Tournaments.Add(t1);
            context.SaveChanges();

            context.Players.AddRange(p1, p2);
            context.SaveChanges();
        }
Ejemplo n.º 2
0
        public ActionResult <Team> AddTeamToTournament(long tournamentId, long id)
        {
            var team       = _context.TeamItems.Include(i => i.Players).FirstOrDefault(t => t.Id == id);
            var tournament = _context.TournamentItems
                             .Include(i => i.participants)
                             .ThenInclude(j => j.Players)
                             .Where(i => i.Id == tournamentId)
                             .FirstOrDefault();

            if (tournament.participants.Count >= tournament.Capacity)
            {
                return(BadRequest("No more room in tournament"));
            }
            else if (tournament.participants.Contains(team))
            {
                return(BadRequest("Team already in this tournament"));
            }
            else
            {
                tournament.participants.Add(team);
                _context.SaveChanges();


                return(CreatedAtAction(nameof(GetTournaments), tournament));
            }
        }
Ejemplo n.º 3
0
        public ActionResult Create(GameCreateModel gameModel, string tournamentSlug)
        {
            if (gameModel.HomeTeamId == gameModel.AwayTeamId)
            {
                ModelState.AddModelError("AwayTeamId", "A team cannot play itself");
            }
            if (ModelState.IsValid)
            {
                var game = new Game
                {
                    RoundId  = gameModel.RoundId.Value,
                    GameTime = gameModel.GameTime
                };
                db.Games.Add(game);
                db.SaveChanges();

                var model = new GameEditModel
                {
                    Id         = game.Id,
                    HomeTeamId = gameModel.HomeTeamId,
                    AwayTeamId = gameModel.AwayTeamId,
                    GameTime   = gameModel.GameTime,
                    FieldId    = gameModel.FieldId
                };
                return(Edit(model, tournamentSlug));
            }

            var teams = db.Teams.Where(t => t.Tournament.Slug == tournamentSlug);

            ViewBag.HomeTeamId = new SelectList(teams, "Id", "Name");
            ViewBag.AwayTeamId = new SelectList(teams, "Id", "Name");

            ViewBag.RoundId = new SelectList(db.Rounds, "Id", "Name", gameModel.RoundId);
            return(View(gameModel));
        }
        public ActionResult Details(FormCollection collection, int id)
        {
            var matchId = Convert.ToInt32(collection["MatchId"]);

            tournamentContext.matches
            .Include(m => m.team1)
            .Include(m => m.team2)
            .AsQueryable()
            .First(m => m.Id == matchId)
            .SetResult(Convert.ToInt32(collection["Team1Score"]), Convert.ToInt32(collection["Team2Score"]));
            tournamentContext.SaveChanges();
            tournamentContext.tournaments
            .Include("Teams")
            .Include(t => t.CurrentMatches)
            .Include(t => t.CurrentMatches.Select(cm => cm.team1))
            .Include(t => t.CurrentMatches.Select(cm => cm.team2))
            .Include(t => t.CurrentMatches.Select(cm => cm.winner))
            .Include(t => t.CurrentRound)
            .Include(t => t.CurrentRound.Teams)
            .Include(t => t.CurrentRound.Matches)
            .Include(t => t.CurrentRound.Matches.Select(m => m.team1))
            .Include(t => t.CurrentRound.Matches.Select(m => m.team2))
            .Include(t => t.CurrentRound.Matches.Select(m => m.winner))
            .AsQueryable()
            .First(t => t.CurrentMatches.Any(cm => cm.Id == matchId))
            .SetCurrentMatches();
            tournamentContext.SaveChanges();
            return(RedirectToAction("Details", id));
        }
Ejemplo n.º 5
0
        public IActionResult Create(Tournament item)
        {
            item.ResetProps();
            _context.Tournaments.Add(item);
            _context.SaveChanges();

            return(Created(new Uri($"{Request.Path}/{item.Id}", UriKind.Relative), item));
        }
Ejemplo n.º 6
0
 public ActionResult EditMatch(Match m)
 {
     if (ModelState.IsValid)
     {
         db.Entry(m).State = EntityState.Modified;
         db.SaveChanges();
         RedirectToAction("Index");
     }
     return(View(m));
 }
Ejemplo n.º 7
0
        public ActionResult Create([Bind(Include = "Id,Name,Description,Address")] Field field)
        {
            if (ModelState.IsValid)
            {
                db.Fields.Add(field);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(field));
        }
Ejemplo n.º 8
0
        public ActionResult Create([Bind(Include = "TeamID,TeamName,League")] Team team)
        {
            if (ModelState.IsValid)
            {
                db.Teams.Add(team);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(team));
        }
Ejemplo n.º 9
0
 public virtual void Add(T obj)
 {
     try
     {
         _context.Set <T>().Add(obj);
         _context.SaveChanges();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 10
0
        public ActionResult Create(Tournament tournament)
        {
            if (ModelState.IsValid)
            {
                db.Tournaments.Add(tournament);
                tournament.Owner = db.Users.First(u => u.Name == User.Identity.Name);
                db.SaveChanges();
                return(RedirectToAction("Index", "Home"));
            }

            return(View(tournament));
        }
Ejemplo n.º 11
0
        public ActionResult Create(Round round, string tournamentSlug)
        {
            if (ModelState.IsValid)
            {
                db.Rounds.Add(round);
                db.SaveChanges();
                return(RedirectToAction("Standings", "Home", new { tournamentSlug }));
            }

            ViewBag.TournamentId = new SelectList(db.Tournaments, "Id", "Name", round.TournamentId);
            return(View(round));
        }
Ejemplo n.º 12
0
        public ActionResult Create(Team team, string tournamentSlug)
        {
            if (ModelState.IsValid)
            {
                var tournament = db.Tournaments.First(t => t.Slug == tournamentSlug);
                team.Tournament = tournament;
                db.Teams.Add(team);
                db.SaveChanges();
                return(RedirectToAction("Standings", "Home", new { tournamentSlug }));
            }

            return(View(team));
        }
Ejemplo n.º 13
0
        public IActionResult PutPlayer(long id, Player item)
        {
            var  existingPlayer = _context.PlayerItems.Where(s => s.Id == id).FirstOrDefault <Player>();
            var  identity       = HttpContext.User.Claims.ToList();
            long userId;

            if (identity[0].Value != "null")
            {
                userId = long.Parse(identity[0].Value);
            }
            else
            {
                userId = -99;
            }
            var role = identity[1].Value;

            if (existingPlayer != null && userId == id)
            {
                existingPlayer.InGameName = item.InGameName;
                existingPlayer.Region     = item.Region;
                existingPlayer.Username   = item.Username;
                _context.SaveChanges();
                return(NoContent());
            }
            else
            {
                return(NotFound());
            }
        }
Ejemplo n.º 14
0
        public PartialViewResult StandingsPartial(int?homeScore, int?awayScore, int gameId, int tournamentId)
        {
            var dbResult = db.Games.SingleOrDefault(g => g.Id == gameId);

            if (dbResult != null)
            {
                if (!homeScore.HasValue || !awayScore.HasValue)
                {
                    dbResult.HomePlayerScore = null;
                    dbResult.AwayPlayerScore = null;
                    dbResult.GameDate        = null;
                    db.SaveChanges();
                }
                else if (homeScore >= 0 && awayScore >= 0)
                {
                    dbResult.HomePlayerScore = homeScore;
                    dbResult.AwayPlayerScore = awayScore;
                    dbResult.GameDate        = DateTime.Now;
                    db.SaveChanges();
                }
            }

            var games      = db.Games.Where(g => g.TournamentId == tournamentId).ToList();
            var playerList = games.Select(p => p.HomePlayerId).Union(games.Select(p => p.AwayPlayerId).Distinct().ToList());

            var players = db.Players.Where(p => playerList.Contains(p.Id)).ToList();

            var standings = tournamentHelper.GenerateStandings(players, games);

            return(PartialView("StandingsPartial", standings));
        }
Ejemplo n.º 15
0
 public ActionResult Create([Bind(Include = "ID,TeamID,LastName,FirstName,RightHand,DateOfBirth")] Player player)
 {
     try
     {
         if (ModelState.IsValid)
         {
             db.Players.Add(player);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException /* dex */)
     {
         //Log the error (uncomment dex variable name and add a line here to write a log.
         ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem persists see your system administrator.");
     }
     return(View(player));
 }
Ejemplo n.º 16
0
        // DELETE: api/Tournament/5
        public void Delete(int id)
        {
            using (var context = new TournamentContext())
            {
                var tournament = context.Tournaments.FirstOrDefault(t => t.ID == id);

                context.Tournaments.Remove(tournament);
                context.SaveChanges();
            }
        }
Ejemplo n.º 17
0
        public async Task <ActionResult <Player> > AddPlayerToTeam(int teamId, int playerId)
        {
            var           team    = _context.TeamItems.Include(c => c.Players).FirstOrDefault(j => j.Id == teamId);
            var           player  = _context.PlayerItems.FirstOrDefault(j => j.Id == playerId);
            List <Player> players = team.Players;

            if (players.Contains(player))
            {
                return(BadRequest("This player already exists in team"));
            }
            //else if(_context.TeamItems.Include(c => c.Players).Where(t => t.Players.Contains(player)).FirstOrDefaultAsync() != null)
            //{
            //    return BadRequest("Player is in another team");
            //}
            else
            {
                players.Add(player);
                team.Players = players;
                _context.SaveChanges();
                return(CreatedAtAction(nameof(GetTeams), team));
            }
        }
Ejemplo n.º 18
0
 public ActionResult Register(PersonModel Account)
 {
     if (ModelState.IsValid)
     {
         using (TournamentContext db = new TournamentContext())
         {
             db.TournamentModels.Add(Account);
             db.SaveChanges();
         }
         ModelState.Clear();
         ViewBag.Message = Account.FirstName + " " + Account.LastName + " succesful register.";
     }
     return(View());
 }
Ejemplo n.º 19
0
        // POST: api/Tournament
        public void Post(TournamentRequest request)
        {
            var tournament = new Tournament();

            tournament.Active  = true;
            tournament.Title   = request.Title;
            tournament.Matches = new List <Match>();

            if (request.Competitors == 2)
            {
                CreateBrackets(1, tournament.Matches);
            }
            else if (request.Competitors <= 4)
            {
                CreateBrackets(2, tournament.Matches);
            }
            else if (request.Competitors <= 8)
            {
                CreateBrackets(3, tournament.Matches);
            }
            else if (request.Competitors <= 16)
            {
                CreateBrackets(4, tournament.Matches);
            }
            else if (request.Competitors <= 32)
            {
                CreateBrackets(5, tournament.Matches);
            }
            else if (request.Competitors <= 64)
            {
                CreateBrackets(6, tournament.Matches);
            }
            else
            {
                throw new Exception("Too many competitors");
            }

            using (var context = new TournamentContext())
            {
                context.Tournaments.Add(tournament);
                context.SaveChanges();
            }
        }
Ejemplo n.º 20
0
 public void Create(TEntity item)
 {
     _dbSet.Add(item);
     _context.SaveChanges();
 }
Ejemplo n.º 21
0
 public void SaveChanges()
 {
     tournamentContext.SaveChanges();
 }
Ejemplo n.º 22
0
        public static void EnsureSeed(this TournamentContext dataContext)
        {
            dataContext.Database.EnsureCreated();
            //using (var transaction = dataContext.Database.BeginTransaction())
            //{

            var tournament = new TournamentDto()
            {
                Id             = 1,
                Caption        = "New Tournament",
                Description    = "First added tournament",
                StartDate      = DateTime.Now,
                EndDate        = DateTime.Now.AddDays(3),
                TournamentTime = 20
            };
            var tournament2 = new TournamentDto()
            {
                Id             = 2,
                Caption        = "Old Tournament",
                Description    = "First added tournament",
                StartDate      = DateTime.Now,
                EndDate        = DateTime.Now.AddDays(3),
                TournamentTime = 20
            };

            if (!dataContext.Tournaments.Any())
            {
                dataContext.Tournaments.Add(tournament);
                dataContext.Tournaments.Add(tournament2);
                //dataContext.Database.ExecuteSqlRaw("SET IDENTITY_INSERT Tournaments ON");
                dataContext.SaveChanges();
                //dataContext.Database.ExecuteSqlRaw("SET IDENTITY_INSERT Tournaments OFF");
            }

            if (!dataContext.TournamentsUsers.Any())
            {
                dataContext.TournamentsUsers.Add(new TournamentsUsers()
                {
                    Tournament = tournament,
                    UserId     = "5e7398bde6ab1940182c5cfd"
                });
                dataContext.SaveChanges();
            }

            if (!dataContext.Exercises.Any())
            {
                dataContext.Exercises.AddRange(
                    new ExerciseDto()
                {
                    Id          = 1,
                    Text        = "1+1",
                    Answer      = "2",
                    OrderNumber = 1,
                    Tournament  = tournament
                }, new ExerciseDto()
                {
                    Id          = 2,
                    Text        = "3+5",
                    Answer      = "8",
                    OrderNumber = 2,
                    Tournament  = tournament
                }, new ExerciseDto()
                {
                    Id          = 3,
                    Text        = "First three letters of alphabet",
                    Answer      = "a,b,c",
                    OrderNumber = 3,
                    Tournament  = tournament
                }, new ExerciseDto()
                {
                    Id          = 4,
                    Text        = "First three letters of alphabet",
                    Answer      = "a,b,c",
                    OrderNumber = 3,
                    Tournament  = tournament2
                });
                //dataContext.Database.ExecuteSqlRaw("SET IDENTITY_INSERT Exercises ON");
                dataContext.SaveChanges();
                //dataContext.Database.ExecuteSqlRaw("SET IDENTITY_INSERT Exercises OFF");
            }

            if (!dataContext.ExercisesUsers.Any())
            {
                dataContext.ExercisesUsers.AddRange(
                    new ExercisesUsers()
                {
                    ExerciseId = 1,
                    UserId     = "5e7398bde6ab1940182c5cfd",
                    UserAnswer = "2",
                    IsCorrect  = true
                });
                dataContext.SaveChanges();
            }
            dataContext.SaveChanges();
            //    transaction.Commit();
            //}
        }
Ejemplo n.º 23
0
        public static void SeedData(this TournamentContext dataContext)
        {
            dataContext.Database.EnsureCreated();


            var tournament = new TournamentDto()
            {
                Caption        = "New Tournament",
                Description    = "First added tournament",
                StartDate      = DateTime.Now,
                EndDate        = DateTime.Now.AddDays(3),
                TournamentTime = 20
            };
            var tournament2 = new TournamentDto()
            {
                Caption        = "Old Tournament",
                Description    = "First added tournament",
                StartDate      = DateTime.Now,
                EndDate        = DateTime.Now.AddDays(3),
                TournamentTime = 20
            };

            if (!dataContext.Tournaments.Any())
            {
                dataContext.Tournaments.Add(tournament);
                dataContext.Tournaments.Add(tournament2);
                dataContext.SaveChanges();
            }

            if (!dataContext.TournamentsUsers.Any())
            {
                dataContext.TournamentsUsers.Add(new TournamentsUsers()
                {
                    Tournament = tournament,
                    UserId     = "5e7398bde6ab1940182c5cfd"
                });
                dataContext.SaveChanges();
            }

            if (!dataContext.Exercises.Any())
            {
                dataContext.Exercises.AddRange(
                    new ExerciseDto()
                {
                    Text        = "1+1",
                    Answer      = "2",
                    OrderNumber = 1,
                    Tournament  = tournament
                }, new ExerciseDto()
                {
                    Text        = "3+5",
                    Answer      = "8",
                    OrderNumber = 2,
                    Tournament  = tournament
                }, new ExerciseDto()
                {
                    Text        = "First three letters of alphabet",
                    Answer      = "a,b,c",
                    OrderNumber = 3,
                    Tournament  = tournament
                }, new ExerciseDto()
                {
                    Text        = "First three letters of alphabet",
                    Answer      = "a,b,c",
                    OrderNumber = 3,
                    Tournament  = tournament2
                });
                dataContext.SaveChanges();
            }

            if (!dataContext.ExercisesUsers.Any())
            {
                dataContext.ExercisesUsers.AddRange(
                    new ExercisesUsers()
                {
                    ExerciseId = 1,
                    UserId     = "5e7398bde6ab1940182c5cfd",
                    UserAnswer = "2",
                    IsCorrect  = true
                });
                dataContext.SaveChanges();
            }
            dataContext.SaveChanges();
        }
Ejemplo n.º 24
0
 public void SaveChanges()
 {
     _context.SaveChanges();
 }
Ejemplo n.º 25
0
 public void SaveChanges()
 {
     TContext.SaveChanges();
 }
Ejemplo n.º 26
0
        private static void CreateDatabase()
        {
            TournamentContext context = new TournamentContext();

            context.Database.EnsureDeleted();
            context.Database.EnsureCreated();

            Tournament tournament1 = new Tournament()
            {
                TournamentName     = "Tournament Of the year : Christmas tournament ",
                TournamentDate     = Convert.ToDateTime("25/12/1392"),
                Price              = 100,
                Prize              = 12500,
                TournamentLocation = "Castle of Vincennes",
                Description        = "This is the last tournament of the year, you will have the chance to fight in front of the king in person",
                TournamentType     = "With Mount",
                Participants       = 100,
                Champion           = "Creddred",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament2 = new Tournament()
            {
                TournamentName     = "Easter tournament",
                TournamentDate     = Convert.ToDateTime("15/04/1392"),
                Price              = 4,
                Prize              = 500,
                TournamentLocation = "Castle of Roquetaillade",
                Description        = "We are not looking for eggs but for bloodthirsty fighters",
                TournamentType     = "With mount",
                Participants       = 50,
                Champion           = "Anosdagan",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament3 = new Tournament()
            {
                TournamentName     = "Spring Tournament",
                TournamentDate     = Convert.ToDateTime("20/03/1392"),
                Price              = 1,
                Prize              = 100,
                TournamentLocation = "Castle of Faverges",
                Description        = "No time to see the tulips bloom, the fights have started again",
                TournamentType     = "Without Mount",
                Participants       = 25,
                Champion           = "Holdjamy",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament4 = new Tournament()
            {
                TournamentName     = "Mother's Day tournament",
                TournamentDate     = Convert.ToDateTime("30/05/1392"),
                Price              = 10,
                Prize              = 250,
                TournamentLocation = "Castle of Veauce",
                Description        = "Many mothers lose their children during this tournament",
                TournamentType     = "Without Mount",
                Participants       = 30,
                Champion           = "Creddred",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament5 = new Tournament()
            {
                TournamentName     = "Ascension Tournament",
                TournamentDate     = Convert.ToDateTime("13/05/1392 "),
                Price              = 10,
                Prize              = 1000,
                TournamentLocation = "Castle of Rouen",
                Description        = "As the symbol of faith expresses it: “He ascended into Heaven; he is seated at the right hand of the Father. He will come again in glory to judge the living and the dead, and his reign will have no end ",
                TournamentType     = "With Mount",
                Participants       = 75,
                Champion           = "Asnosdagan",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament6 = new Tournament()
            {
                TournamentName     = "Epiphany tournament",
                TournamentDate     = Convert.ToDateTime("06/01/1392"),
                Price              = 1,
                Prize              = 100,
                TournamentLocation = "Palace of the Dukes of Bourgogne",
                Description        = "Epiphany: opening of the Combats, we have been waiting for this since last year",
                TournamentType     = "Without Mount",
                Participants       = 50,
                Champion           = "",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament7 = new Tournament()
            {
                TournamentName     = "Pentecote tournament",
                TournamentDate     = Convert.ToDateTime("23/05/1392"),
                Price              = 50,
                Prize              = 1000,
                TournamentLocation = "Castle of Courtanvaux",
                Description        = "",
                TournamentType     = "With Mount",
                Participants       = 50,
                Champion           = "",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament8 = new Tournament()
            {
                TournamentName     = "Assumption tournament",
                TournamentDate     = Convert.ToDateTime("15/08/1392"),
                Price              = 50,
                Prize              = 1000,
                TournamentLocation = "Castle of Thorens",
                Description        = "The Assumption of the Blessed Virgin and also of our fighters",
                TournamentType     = "With Mount",
                Participants       = 100,
                Champion           = "",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament9 = new Tournament()
            {
                TournamentName     = "Toussaint tournament",
                TournamentDate     = Convert.ToDateTime("01/11/1392"),
                Price              = 25,
                Prize              = 500,
                TournamentLocation = "Castle of Falaise",
                Description        = "The day after the feast of the dead: enough to honor all these fighters who left too early",
                TournamentType     = "Without Mount",
                Participants       = 100,
                Champion           = "",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };
            Tournament tournament10 = new Tournament()
            {
                TournamentName     = "Charles V tournament ",
                TournamentDate     = Convert.ToDateTime("01/11/1392"),
                Price              = 25,
                Prize              = 500,
                TournamentLocation = "Castle of Falaise",
                Description        = "The day after the feast of the dead: enough to honor all these fighters who left too early",
                TournamentType     = "Without Mount",
                Participants       = 100,
                Champion           = "",
                Images             = "", // URL image tournoi
                Videos             = "", // URL image tournoi
            };

            context.AddRange(tournament1, tournament2, tournament3, tournament4, tournament5, tournament6, tournament7, tournament8, tournament9, tournament10);
            context.SaveChanges();

            Knight knight1 = new Knight()
            {
                KnightName     = "Anosdagan",
                Age            = 24,
                Victories      = 10,
                Defeats        = 1,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Sword, shield",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Plate armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = true,
                MountType      = "Warhorse",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "Cannasson",
                Moto           = "Houra!",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 3,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight2 = new Knight()
            {
                KnightName     = "Autfred",
                Age            = 32,
                Victories      = 3,
                Defeats        = 6,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Spear",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Breastplate",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "I am not afraid of death !",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 21,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight3 = new Knight()
            {
                KnightName     = "Bertlance",
                Age            = 43,
                Victories      = 25,
                Defeats        = 9,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Mace",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Chainmail",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "Fear me !",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 4,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight4 = new Knight()
            {
                KnightName     = "Aeltor",
                Age            = 22,
                Victories      = 0,
                Defeats        = 5,
                Banner         = "http://milhiecreation.com/imagesHackaton/FinalBanners/banner_1",     // URL banner
                Weapons        = "Wood stick",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Quilted weave",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "these last words are 'stop it!'",
                Avatar         = "http://milhiecreation.com/imagesHackaton/Avatar/Aeltor.png", // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com",                                                //adress mail
                PigeonIcons    = "",                                                           // URL PigeonIcons
                Alive          = false,
                AliveIcons     = "",                                                           // URL AliveIcons
                Ranking        = 25,
                RankingIcons   = "",                                                           // URL RankingIcons
                SuccessIcons   = ""                                                            // URL SuccessIcons
            };
            Knight knight5 = new Knight()
            {
                KnightName     = "Creddred",
                Age            = 28,
                Victories      = 31,
                Defeats        = 0,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Two handed sword",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Plate armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = true,
                MountType      = "Griffon",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "Ragnar",
                Moto           = "Cool, you are food for my pet",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 1,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight6 = new Knight()
            {
                KnightName     = "Daganho",
                Age            = 23,
                Victories      = 0,
                Defeats        = 0,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Dague",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Quilted weave",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "Tzi shu force is with me",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 20,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight7 = new Knight()
            {
                KnightName     = "Ethward",
                Age            = 29,
                Victories      = 15,
                Defeats        = 8,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Bow",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Quilted Weave",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "My arrows are faster than your weapons",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 9,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight8 = new Knight()
            {
                KnightName     = "Holdjamy",
                Age            = 34,
                Victories      = 25,
                Defeats        = 4,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Hammer",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Vikings armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = true,
                MountType      = "Wolf",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "Canis",
                Moto           = "I have thor's hammer!",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 2,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight9 = new Knight()
            {
                KnightName     = "Jasmor",
                Age            = 31,
                Victories      = 8,
                Defeats        = 6,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Scourge",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Scale armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = true,
                MountType      = "Pagasus",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "Pegasus",
                Moto           = "My animal is still in the air",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 11,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight10 = new Knight()
            {
                KnightName     = "Leodagan",
                Age            = 25,
                Victories      = 15,
                Defeats        = 4,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Axe",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Plate armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = true,
                MountType      = "Hippogriff",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "Buck",
                Moto           = "Comme and measure yourself against me",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 5,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight11 = new Knight()
            {
                KnightName     = "Lotaut",
                Age            = 25,
                Victories      = 6,
                Defeats        = 4,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Dagger",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Quited weave",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = true,
                MountType      = "Boar",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "Grouik",
                Moto           = "My pet isn't fodd",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 15,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight12 = new Knight()
            {
                KnightName     = "Nulfar",
                Age            = 29,
                Victories      = 1,
                Defeats        = 8,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Sword",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Harness",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "I will be the best !",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = false,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 24,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight13 = new Knight()
            {
                KnightName     = "Percyward",
                Age            = 28,
                Victories      = 2,
                Defeats        = 4,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Sword",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Harness",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "I will be the best !",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = false,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 23,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight14 = new Knight()
            {
                KnightName     = "Agaaut",
                Age            = 28,
                Victories      = 19,
                Defeats        = 8,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Hallebarde",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Plate armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "Drop to my halberd",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 6,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight15 = new Knight()
            {
                KnightName     = "Bojas",
                Age            = 18,
                Victories      = 4,
                Defeats        = 4,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Spear",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Breastplate",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "Drop to my halberd",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 17,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight16 = new Knight()
            {
                KnightName     = "Jeain",
                Age            = 27,
                Victories      = 17,
                Defeats        = 9,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Mace",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Chainmail",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = true,
                MountType      = "Unicorn",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "Pony",
                Moto           = "Do you know the realy death ?",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 7,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight17 = new Knight()
            {
                KnightName     = "Nardarnold",
                Age            = 27,
                Victories      = 5,
                Defeats        = 4,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Scourge",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Scale Armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "Could you be nice to me ?",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 18,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight18 = new Knight()
            {
                KnightName     = "Tuslot",
                Age            = 27,
                Victories      = 0,
                Defeats        = 1,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Dagger",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Quilted weave",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "Let's go",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = false,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 22,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight19 = new Knight()
            {
                KnightName     = "Valeranos",
                Age            = 27,
                Victories      = 9,
                Defeats        = 4,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Scourge",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Plate Armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = true,
                MountType      = "Camel",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "Case",
                Moto           = "Say your prayer",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 8,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight20 = new Knight()
            {
                KnightName     = "Reindric",
                Age            = 44,
                Victories      = 37,
                Defeats        = 25,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Sword",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Plate Armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "There was a time when i was first",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 10,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight21 = new Knight()
            {
                KnightName     = "Rollrein",
                Age            = 21,
                Victories      = 3,
                Defeats        = 1,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Mace",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Chainmail",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "I have the courage to face the greatest",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 19,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight22 = new Knight()
            {
                KnightName     = "Tanje",
                Age            = 24,
                Victories      = 7,
                Defeats        = 3,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Sword",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Breastplate",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 16,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight23 = new Knight()
            {
                KnightName     = "Telperce",
                Age            = 28,
                Victories      = 14,
                Defeats        = 8,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Spear",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Harness",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 12,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight24 = new Knight()
            {
                KnightName     = "Thurward",
                Age            = 36,
                Victories      = 14,
                Defeats        = 11,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Axe",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Scale Armor",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = true,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 13,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = ""             // URL SuccessIcons
            };
            Knight knight25 = new Knight()
            {
                KnightName     = "Vallande",
                Age            = 26,
                Victories      = 18,
                Defeats        = 9,
                Banner         = "",                                                                   // URL banner
                Weapons        = "Dagger",
                WeaponsIcons   = "http://milhiecreation.com/imagesHackaton/FinalIcon/Icon_weapon.png", // URL weaponsIcons
                Armors         = "Quilted Weave",
                ArmorsIcons    = "",                                                                   // URL armorIcons
                Mount          = false,
                MountType      = "",
                MountTypeIcons = "", // URL typeIcons
                MountName      = "",
                Moto           = "",
                Avatar         = "",            // URL avatar
                Region         = "",
                Pigeon         = "@pigeon.com", //adress mail
                PigeonIcons    = "",            // URL PigeonIcons
                Alive          = false,
                AliveIcons     = "",            // URL AliveIcons
                Ranking        = 14,
                RankingIcons   = "",            // URL RankingIcons
                SuccessIcons   = "",            // URL SuccessIcons
            };

            context.AddRange(knight1, knight2, knight3, knight4, knight5, knight6, knight7, knight8, knight9, knight10, knight11, knight12, knight13,
                             knight14, knight15, knight16, knight17, knight18, knight19, knight20, knight21, knight22, knight23, knight24, knight25);
            context.SaveChanges();
        }