static void Main(string[] args)
        {
            var generator = new BasicUrlGenerator();

            //const int testLength = 256985;
            //for (int i = 0; i < testLength; i++)
            //{
            //    Console.WriteLine(i + ": " + generator.GetUrl(i));
            //}

            var sw = new Stopwatch();
            //sw.Start();
            //generator.GetUrl(0);
            //sw.Stop();

            //Console.WriteLine("1: " + sw.Elapsed);

            sw.Restart();
            Console.WriteLine(generator.GetUrl(50000000));
            //generator.GetUrl(500000);
            sw.Stop();

            Console.WriteLine("2: " + sw.Elapsed);

            Console.ReadKey();
        }
        public ActionResult Submit(int id, string name)
        {
            var symbol = (Symbol) Session["ChosenSymbol"];

            var player = new Player()
            {
                Name = name,
                Symbol = symbol
            };

            using (var context = new GameDbContext())
            {
                var game = context.Games
                    .Include(g => g.Player1)
                    .Include(g => g.Player2)
                    .SingleOrDefault(g => g.Id == id);

                if (game == null)
                {
                    game = new Game();
                    game.Player1 = player;

                    // TODO: przemyśl czy:
                    // TODO: - powinieneś trzymać referencję do DataLoader w tym obiekcie, czy tworzyć każdorazowo, gdy jest potrzebny
                    // TODO: - jw. z BasicUrlGenerator

                    context.Players.Add(player);
                    context.Games.Add(game);
                    context.SaveChanges();

                    var urlGenerator = new BasicUrlGenerator();
                    game.RefLink = urlGenerator.GetUrl(game.Id);

                    context.SaveChanges();

                    return PartialView("~/Views/NewLayout/Create.cshtml", game);
                }
                else
                {
                    game.Player2 = player;

                    context.Players.Add(player);
                    context.SaveChanges();

                    return PartialView("~/Views/NewLayout/ShowPartial.cshtml", game);
                }
            }
        }