Add statistics to list of rom sets.

This commit is contained in:
2020-08-24 01:57:15 +01:00
parent 86b63e5e31
commit 3d87c2e778
7 changed files with 108 additions and 44 deletions

View File

@@ -25,6 +25,7 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
using RomRepoMgr.Database.Models;
namespace RomRepoMgr.Database
@@ -62,7 +63,12 @@ namespace RomRepoMgr.Database
public static Context Create(string dbPath)
{
var optionsBuilder = new DbContextOptionsBuilder();
optionsBuilder.UseLazyLoadingProxies().UseSqlite($"Data Source={dbPath}");
optionsBuilder.UseLazyLoadingProxies()
#if DEBUG
.UseLoggerFactory(LoggerFactory.Create(builder => builder.AddConsole()))
#endif
.UseSqlite($"Data Source={dbPath}");
return new Context(optionsBuilder.Options);
}