Convert to db so I don't have to parse files all the time

This commit is contained in:
Lani Aung
2021-10-18 21:03:53 -06:00
parent 21d96499da
commit 372d0ad86a
9 changed files with 137 additions and 111 deletions
+7
View File
@@ -1,9 +1,11 @@
using Dapper;
using fxl.codes.kisekae.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Npgsql.Logging;
namespace fxl.codes.kisekae
{
@@ -24,6 +26,7 @@ namespace fxl.codes.kisekae
services.AddSingleton<ConfigurationReaderService>();
services.AddSingleton<FileParserService>();
services.AddScoped<DatabaseService>();
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
@@ -32,6 +35,8 @@ namespace fxl.codes.kisekae
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
NpgsqlLogManager.Provider = new ConsoleLoggingProvider(NpgsqlLogLevel.Trace);
NpgsqlLogManager.IsParameterLoggingEnabled = true;
}
else
{
@@ -53,6 +58,8 @@ namespace fxl.codes.kisekae
"default",
"{controller=Home}/{action=Index}/{id?}");
});
DefaultTypeMap.MatchNamesWithUnderscores = true;
}
}
}