aboutsummaryrefslogtreecommitdiff
path: root/PagerContext.cs
diff options
context:
space:
mode:
Diffstat (limited to 'PagerContext.cs')
-rw-r--r--PagerContext.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/PagerContext.cs b/PagerContext.cs
new file mode 100644
index 0000000..73e675f
--- /dev/null
+++ b/PagerContext.cs
@@ -0,0 +1,17 @@
+using Microsoft.EntityFrameworkCore;
+
+namespace PagerParser;
+
+public class PagerContext : DbContext {
+ public DbSet<PagerMessage> PagerMessages { get; set; }
+ public DbSet<ParsedPagerMessage> ParsedPagerMessages { get; set; }
+ public DbSet<GpsPosition> GpsPositions { get; set; }
+
+ private IConfiguration config;
+
+ public PagerContext(IConfiguration config) =>
+ this.config = config;
+
+ protected override void OnConfiguring(DbContextOptionsBuilder options) =>
+ options.UseNpgsql(config.GetConnectionString("DefaultConnection"));
+} \ No newline at end of file