public static void ToonSkinsMetBepaaldePrijsVan1Champion()
        {
            using var context = new LeagueOfLegendsContext();

            Console.WriteLine("Geef de championNaam op waarvan je alle skins wilt zien");
            var gekozenChampion = Console.ReadLine().ToUpper();

            Console.WriteLine();
            Console.WriteLine("Geef de maximale RPprijs op die je wilt betalen voor de skin");

            var gekozenRPPrijs = int.Parse(Console.ReadLine());

            Console.Clear();
            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.Write("------------------------------");
            LijntjesMetLengteChampionNaam(gekozenChampion);
            Console.WriteLine($"\nALLE SKINS VAN {gekozenChampion} ONDER {gekozenRPPrijs} RP");
            Console.Write("------------------------------");
            LijntjesMetLengteChampionNaam(gekozenChampion);
            Console.WriteLine();

            var skins = from skin in context.Skins.Include("Champion")
                        where skin.Champion.ChampionNaam.ToUpper() == gekozenChampion
                        where skin.RiotPointPrice < gekozenRPPrijs && skin.RiotPointPrice > 0

                        orderby skin.SkinNaam
                        select skin;


            Console.ForegroundColor = ConsoleColor.Cyan;
            foreach (var skin in skins)
            {
                string riotPointString;
                if (skin.RiotPointPrice == Decimal.Zero)
                {
                    riotPointString = (skin.RiotPointPrice).ToString();
                    riotPointString = "Niet verkrijgbaar met";
                }
                else
                {
                    riotPointString = (skin.RiotPointPrice).ToString();
                }
                Console.WriteLine($"{skin.SkinNaam}:\t {riotPointString} RP");
            }
        }
        public static void ToonAlleChampionsAlfabetisch()
        {
            using var context = new LeagueOfLegendsContext();

            var champions = from champion in context.Champions
                            orderby champion.ChampionNaam
                            select champion;

            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("----------------------------------------");
            Console.WriteLine("ALLE CHAMPIONS IN ALFABETISCHE VOLGORDE");
            Console.WriteLine("----------------------------------------");
            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.Cyan;

            foreach (var champion in champions)
            {
                Console.WriteLine($"{champion.ChampionNaam}");
            }
        }
Пример #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, LeagueOfLegendsContext lolContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            //app.UseMvc();

            DBInit.Initialize(lolContext);
            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Пример #4
0
 public HeroesRepository(LeagueOfLegendsContext dbContext)
 {
     _dbContext = dbContext;
 }