From 5e2fc60ba51b84bfca697f041bbf28b4f1b0c552 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com>
Date: Fri, 17 Feb 2023 10:54:18 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=93=E5=82=A8Add?=
=?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ZR.Repository/BaseRepository.cs | 4 ++--
ZR.Repository/IBaseRepository.cs | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ZR.Repository/BaseRepository.cs b/ZR.Repository/BaseRepository.cs
index a5c3f17..26dcf40 100644
--- a/ZR.Repository/BaseRepository.cs
+++ b/ZR.Repository/BaseRepository.cs
@@ -41,9 +41,9 @@ namespace ZR.Repository
///
///
///
- public int Add(T t)
+ public int Add(T t, bool ignoreNull = true)
{
- return Context.Insertable(t).IgnoreColumns(true).ExecuteCommand();
+ return Context.Insertable(t).IgnoreColumns(ignoreNullColumn: ignoreNull).ExecuteCommand();
}
public int Insert(List t)
diff --git a/ZR.Repository/IBaseRepository.cs b/ZR.Repository/IBaseRepository.cs
index 25aa897..640612f 100644
--- a/ZR.Repository/IBaseRepository.cs
+++ b/ZR.Repository/IBaseRepository.cs
@@ -10,7 +10,7 @@ namespace ZR.Repository
public interface IBaseRepository : ISimpleClient where T : class, new()
{
#region add
- int Add(T t);
+ int Add(T t, bool ignoreNull = true);
int Insert(List t);
int Insert(T parm, Expression> iClumns = null, bool ignoreNull = true);