From b6b9281f71c1a4210ed32dbc32dcee4ee5d03643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?jian=E7=8E=84=E5=86=B0?= Date: Tue, 23 Mar 2021 16:50:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dbyte[]=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=9A=84=E4=B9=90=E8=A7=82=E9=94=81=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FreeSql/Internal/CommonProvider/InsertProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeSql/Internal/CommonProvider/InsertProvider.cs b/FreeSql/Internal/CommonProvider/InsertProvider.cs index 1a1378b7..5a2b62cb 100644 --- a/FreeSql/Internal/CommonProvider/InsertProvider.cs +++ b/FreeSql/Internal/CommonProvider/InsertProvider.cs @@ -179,7 +179,7 @@ namespace FreeSql.Internal.CommonProvider } if (val == null && col.Attribute.MapType == typeof(string) && col.Attribute.IsNullable == false) col.SetValue(data, val = ""); - if (val == null && col.Attribute.MapType == typeof(byte[]) && col.Attribute.IsVersion) + if (col.Attribute.MapType == typeof(byte[]) && (val == null || (val is byte[] bytes && bytes.Length == 0)) && col.Attribute.IsVersion) col.SetValue(data, val = Utils.GuidToBytes(Guid.NewGuid())); } }