From 59335aa1be9467094530eec5ee6b0b33f4bba81b Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 4 Sep 2023 20:40:14 +0800 Subject: [PATCH] Update ContextMethods --- Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs index b1a7273d5..816f2b7da 100644 --- a/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs +++ b/Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs @@ -852,7 +852,14 @@ namespace SqlSugar var row = result.NewRow(); foreach (var key in item.Keys) { - row[key] = item[key]; + if (item[key] == null) + { + row[key] = DBNull.Value; + } + else + { + row[key] = item[key]; + } } result.Rows.Add(row);