// 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"); }); }
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(); }
public UserService(DndContext dbContext) { this.db = dbContext; }