// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, RatingDbContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); try { context.LoadJSON(); } catch (System.Exception e) { System.Console.WriteLine(e.Message); System.Console.WriteLine("Unable to Load JSON File to RatingDbContext"); } }
public void Setup() { Context = new RatingDbContext(); BeerRating = new BeerRatingService(Context); }
public BeerRatingService(RatingDbContext userRatingDb) { this.userRatingDb = userRatingDb; }