コード例 #1
0
 public HeroInfoRepository(HeroInfoContext context)
 {
     _context = context;
 }
コード例 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, HeroInfoContext heroInfoContext)
        {
            loggerFactory.AddConsole();

            app.UseMvc();

            AutoMapper.Mapper.Initialize(cfg =>
            {
                cfg.CreateMap <Entities.Hero, Models.HeroDto>();
                cfg.CreateMap <Entities.CounterPick, Models.CounterPickDto>();
            });

            heroInfoContext.EnsureSeedDataForContext();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.Run(async(context) =>
            {
                await context.Response.WriteAsync("Hello World!");
            });
        }