aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Events/EventBus.cs3
-rw-r--r--src/slskd/Events/EventsDbContext.cs29
2 files changed, 15 insertions, 17 deletions
diff --git a/src/slskd/Events/EventBus.cs b/src/slskd/Events/EventBus.cs
index 15f75fd0..b38591b3 100644
--- a/src/slskd/Events/EventBus.cs
+++ b/src/slskd/Events/EventBus.cs
@@ -15,7 +15,7 @@
// along with this program. If not, see https://www.gnu.org/licenses/.
// </copyright>
-namespace slskd;
+namespace slskd.Events;
using System;
using System.Collections.Concurrent;
@@ -24,7 +24,6 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Serilog;
-using slskd.Events;
/// <summary>
/// The event bus supporting interoperability and ancillary functions.
diff --git a/src/slskd/Events/EventsDbContext.cs b/src/slskd/Events/EventsDbContext.cs
index 65b09699..9acbc9a4 100644
--- a/src/slskd/Events/EventsDbContext.cs
+++ b/src/slskd/Events/EventsDbContext.cs
@@ -15,27 +15,26 @@
// along with this program. If not, see https://www.gnu.org/licenses/.
// </copyright>
+namespace slskd.Events;
+
using System;
using Microsoft.EntityFrameworkCore;
-namespace slskd.Events
+public class EventsDbContext : DbContext
{
- public class EventsDbContext : DbContext
+ public EventsDbContext(DbContextOptions<EventsDbContext> options)
+ : base(options)
{
- public EventsDbContext(DbContextOptions<EventsDbContext> options)
- : base(options)
- {
- Database.EnsureCreated();
- }
+ Database.EnsureCreated();
+ }
- public DbSet<EventRecord> Events { get; set; }
+ public DbSet<EventRecord> Events { get; set; }
- protected override void OnModelCreating(ModelBuilder modelBuilder)
- {
- modelBuilder
- .Entity<EventRecord>()
- .Property(e => e.Timestamp)
- .HasConversion(v => v, v => DateTime.SpecifyKind(v, DateTimeKind.Utc));
- }
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ modelBuilder
+ .Entity<EventRecord>()
+ .Property(e => e.Timestamp)
+ .HasConversion(v => v, v => DateTime.SpecifyKind(v, DateTimeKind.Utc));
}
} \ No newline at end of file