diff --git a/Behavior/Behaver.cs b/Behaver.cs similarity index 91% rename from Behavior/Behaver.cs rename to Behaver.cs index e75de05..42f2199 100644 --- a/Behavior/Behaver.cs +++ b/Behaver.cs @@ -1,5 +1,6 @@ -namespace vassago.Behavior; +namespace vassago; #pragma warning disable 4014 //the "not awaited" error +using vassago.Behavior; using vassago.Models; using System; using System.Linq; @@ -12,18 +13,18 @@ public class Behaver { private List SelfAccounts { get; set; } = new List(); private User SelfUser { get; set; } - public static List Behaviors { get; private set; } = new List(); + public static List Behaviors { get; private set; } = new List(); internal Behaver() { var subtypes = AppDomain.CurrentDomain.GetAssemblies() .SelectMany(domainAssembly => domainAssembly.GetTypes()) - .Where(type => type.IsSubclassOf(typeof(Behavior)) && !type.IsAbstract && + .Where(type => type.IsSubclassOf(typeof(vassago.Behavior.Behavior)) && !type.IsAbstract && type.GetCustomAttributes(typeof(StaticPlzAttribute),false)?.Any() == true) .ToList(); foreach (var subtype in subtypes) { - Behaviors.Add((Behavior)Activator.CreateInstance(subtype)); + Behaviors.Add((vassago.Behavior.Behavior)Activator.CreateInstance(subtype)); } } static Behaver() { } diff --git a/ConsoleService.cs b/ConsoleService.cs index 051569f..937f136 100644 --- a/ConsoleService.cs +++ b/ConsoleService.cs @@ -44,7 +44,7 @@ namespace vassago public Task StopAsync(CancellationToken cancellationToken) { - throw new NotImplementedException(); + return null; } } } \ No newline at end of file diff --git a/Models/ChattingContext.cs b/Models/ChattingContext.cs index f666d1d..63f6009 100644 --- a/Models/ChattingContext.cs +++ b/Models/ChattingContext.cs @@ -17,6 +17,8 @@ public class ChattingContext : DbContext public ChattingContext(DbContextOptions options) : base(options) { } public ChattingContext() : base() { } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - => optionsBuilder.UseNpgsql(Shared.DBConnectionString) + { + optionsBuilder.UseNpgsql(Shared.DBConnectionString) .EnableSensitiveDataLogging(true); //who the fuck is looking at log output but not allowed to see it? this should be on by default. + } } \ No newline at end of file diff --git a/Program.cs b/Program.cs index ab7ea22..cc937bf 100644 --- a/Program.cs +++ b/Program.cs @@ -6,8 +6,7 @@ var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllersWithViews(); builder.Services.AddSingleton(); -builder.Services.AddDbContext(options => - options.UseNpgsql(builder.Configuration.GetConnectionString("ChattingContext") )); +builder.Services.AddDbContext(); var app = builder.Build();