提交 9a08b899 编写于 作者: D dd

解决npgsql6 datetime类型报错

上级 d88fa666
......@@ -14,6 +14,9 @@ namespace IoTSharp.Data.PostgreSQL
public void OnModelCreating(ModelBuilder modelBuilder)
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
AppContext.SetSwitch("Npgsql.DisableDateTimeInfinityConversions", true);
modelBuilder.Entity<TelemetryData>()
.Property(b => b.DateTime)
.HasColumnType("timestamp with time zone");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册