public EpisodeRepository(
     FallGuysContext fallGuysContext,
     ILogger <EpisodeRepository> logger
     )
 {
     _fallGuysContext = fallGuysContext;
     _logger          = logger;
 }
        private void btnTest_Click(object sender, RoutedEventArgs e)
        {
            var optionsBuilder = new DbContextOptionsBuilder <FallGuysContext>();

            optionsBuilder.UseSqlite(@"Data Source=C:\Users\leekydesu\source\repos\FallGuyStats-Api\FallGuyStats\fallguys.db");
            using (var context = new FallGuysContext(optionsBuilder.Options))
            {
                var foundEpisode = context.Episodes.First();
                boxResults.Text = $"{foundEpisode.Id}, {foundEpisode.Created}, {foundEpisode.EpisodeFinished}, {foundEpisode.Crowns}, {foundEpisode.Fame}, {foundEpisode.Kudos}, {foundEpisode.Season}\r\n\r\n";
                var roundsFromEpisode = context.Rounds.Where(round => round.EpisodeId == foundEpisode.Id);
                foreach (var episodeRound in roundsFromEpisode)
                {
                    boxResults.Text += $"{episodeRound.Id}, {episodeRound.EpisodeId}, {episodeRound.RoundType}, {episodeRound.Qualified}, {episodeRound.Kudos}, {episodeRound.Badge}\r\n";
                }
            }
        }
Beispiel #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, FallGuysContext fallGuysContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            fallGuysContext.Database.EnsureCreated();

            //app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseCors(AllowLocalOrigins);

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            app.UseStaticFiles();
            app.UseSpaStaticFiles();

            app.UseSpa(spa =>
            {
                // To learn more about options for serving an Angular SPA from ASP.NET Core,
                // see https://go.microsoft.com/fwlink/?linkid=864501

                spa.Options.SourcePath = "Angular";

                if (env.IsDevelopment())
                {
                    spa.UseAngularCliServer(npmScript: "start");
                }
            });
        }
Beispiel #4
0
 public EpisodesController(
     FallGuysContext context
     )
 {
     _context = context;
 }
 public RoundsController(FallGuysContext context)
 {
     _context = context;
 }