Beispiel #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, DndContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            db.Database.EnsureCreated();

            app.UseOpenApi();

            app.UseSwaggerUi3();

            app.UseStaticFiles();

            app.UseRouting();

            app.UseCors("AllowAny");

            app.UseAuthentication();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub <ChatHub>("/signalr");
            });
        }
Beispiel #2
0
        public SheetService(DndContext dbContext)
        {
            this.db = dbContext;
            var config = new MapperConfiguration(cfg => {
                cfg.CreateMap <Entities.CharacterSheet, Dto.CharacterSheet>().ReverseMap();
                cfg.CreateMap <Entities.FeatureSkill, Dto.FeatureSkill>().ReverseMap();
                cfg.CreateMap <Entities.Weapon, Dto.Weapon>().ReverseMap();
                cfg.CreateMap <Entities.Spell, Dto.Spell>().ReverseMap();
            });

            mapper = config.CreateMapper();
        }
Beispiel #3
0
 public UserService(DndContext dbContext)
 {
     this.db = dbContext;
 }