DotNetNext / SqlSugar

.Net aot ORM Fastest ORM Simple Easy VB.NET Sqlite orm Oracle ORM Mysql Orm 虚谷数据库 postgresql ORm SqlServer oRm 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET5 ORM .NET6 ORM ClickHouse orm QuestDb ,TDengine ORM,OceanBase orm,GaussDB orm ,Tidb orm Object/Relational Mapping
https://www.donet5.com/Home/Doc
MIT License
5.35k stars 1.34k forks source link

Inserting with sublist on PostgreSQL where the sublist object has nullable DateTime throws #966

Closed Odiriuss closed 3 years ago

Odiriuss commented 3 years ago

Example:

db.Insertable(new Order()
{
    Name = "订单 1",
    CustomId = 1,
    Price = 100,
    CreateTime = DateTime.Now,
    Id = 0,
    Items = new List<OrderItem>() {
          new OrderItem(){
               OrderId=0,
                Price=1,
                 ItemId=1
           },
          new OrderItem(){
               OrderId=0,
                Price=2,
                 ItemId=2
           }
     }
            })
.AddSubList(it => it.Items.First().OrderId)
.ExecuteCommand();

If we do not set CreateTime on OrderItem the following error is thrown:

42804: column "createtime" is of type timestamp without time zone but expression is of type text

DotNetNext commented 3 years ago

being processed

DotNetNext commented 3 years ago

The GITHUB source code has been updated, do you have any questions

DotNetNext commented 3 years ago

NUGET 5.0.4.3-Preview01

Odiriuss commented 3 years ago

NUGET 5.0.4.3-Preview01

Tried it, works now!