From d2959cac3128fbb78016c5ec7902e7fe55efef61 Mon Sep 17 00:00:00 2001 From: jojo aquino Date: Mon, 16 Dec 2024 17:29:00 +0000 Subject: [PATCH] SetDefaultDateTimeKind --- EnotaryoPH/EnotaryoPH.Data/NotaryoDBContext.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/EnotaryoPH/EnotaryoPH.Data/NotaryoDBContext.cs b/EnotaryoPH/EnotaryoPH.Data/NotaryoDBContext.cs index 0b38908..d841847 100644 --- a/EnotaryoPH/EnotaryoPH.Data/NotaryoDBContext.cs +++ b/EnotaryoPH/EnotaryoPH.Data/NotaryoDBContext.cs @@ -1,4 +1,5 @@ using EnotaryoPH.Data.Entities; +using EnotaryoPH.Data.Extensions; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; @@ -12,6 +13,12 @@ namespace EnotaryoPH.Data protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) => optionsBuilder.UseNpgsql(_configuration.GetConnectionString("NotaryoDatabase")); + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.SetDefaultDateTimeKind(DateTimeKind.Utc); + base.OnModelCreating(modelBuilder); + } + public DbSet? ErrorLogs { get; set; } public DbSet? EventLogs { get; set; } public DbSet? IdentificationDocuments { get; set; }