Changed db stuff

This commit is contained in:
2022-07-14 19:31:53 -04:00
parent 450a05fab1
commit 5402923e9f
9 changed files with 40 additions and 16 deletions

View File

@@ -21,7 +21,7 @@ public static class BuilderExtensions
opt.UseNpgsql(dbConnectionString);
});
Type[] repositories = Assembly.GetExecutingAssembly().GetTypes()
.Where(t => t.IsClass && !t.IsAbstract && t.Namespace.Contains(nameof(DBConnection.Repositories)) && typeof(IRepository).IsAssignableFrom(t)).ToArray();
.Where(t => t.IsClass && !t.IsAbstract && (t.Namespace?.Contains(nameof(DBConnection.Repositories)) ?? false) && typeof(IRepository).IsAssignableFrom(t)).ToArray();
foreach (var repo in repositories)
{
var repoInterface = repo.GetInterfaces()