Ejemplo n.º 1
0
        // 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");
            }
        }
Ejemplo n.º 2
0
 public void Setup()
 {
     Context    = new RatingDbContext();
     BeerRating = new BeerRatingService(Context);
 }
Ejemplo n.º 3
0
 public BeerRatingService(RatingDbContext userRatingDb)
 {
     this.userRatingDb = userRatingDb;
 }