diff --git a/Bootstrap.DataAccess/DbManager.cs b/Bootstrap.DataAccess/DbManager.cs
index af473a18..1e9fb503 100644
--- a/Bootstrap.DataAccess/DbManager.cs
+++ b/Bootstrap.DataAccess/DbManager.cs
@@ -18,13 +18,7 @@ namespace Bootstrap.DataAccess
///
public static IDatabase Create(string connectionName = null, bool keepAlive = false)
{
- if (Mappers.GetMapper(typeof(Exceptions), null) == null)
- {
- lock (_locker)
- {
- if (Mappers.GetMapper(typeof(Exceptions), null) == null) Mappers.Register(typeof(Exceptions).Assembly, new BootstrapDataAccessConventionMapper());
- }
- }
+ if (Mappers.GetMapper(typeof(Exceptions), null) == null) Mappers.Register(typeof(Exceptions).Assembly, new BootstrapDataAccessConventionMapper());
var db = Longbow.Data.DbManager.Create(connectionName, keepAlive);
db.ExceptionThrown += (sender, args) => args.Exception.Log(new NameValueCollection() { ["LastCmd"] = db.LastCommand });
return db;
diff --git a/Bootstrap.DataAccess/Helper/DictHelper.cs b/Bootstrap.DataAccess/Helper/DictHelper.cs
index e78f48ef..30e82fc0 100644
--- a/Bootstrap.DataAccess/Helper/DictHelper.cs
+++ b/Bootstrap.DataAccess/Helper/DictHelper.cs
@@ -60,7 +60,6 @@ namespace Bootstrap.DataAccess
{
if (RetrieveSystemModel() && !string.IsNullOrEmpty(p.Id) && RetrieveProtectedDicts().Any(m => m.Id == p.Id)) return true;
- if (p.Id == string.Empty) p.Id = null;
var ret = DbContextManager.Create().Save(p);
if (ret) CacheCleanUtility.ClearCache(dictIds: new List());
return ret;
diff --git a/Bootstrap.DataAccess/Helper/GroupHelper.cs b/Bootstrap.DataAccess/Helper/GroupHelper.cs
index 1a0e88bc..807233b4 100644
--- a/Bootstrap.DataAccess/Helper/GroupHelper.cs
+++ b/Bootstrap.DataAccess/Helper/GroupHelper.cs
@@ -51,7 +51,6 @@ namespace Bootstrap.DataAccess
///
public static bool Save(Group p)
{
- if (p.Id == string.Empty) p.Id = null;
var ret = DbContextManager.Create().Save(p);
if (ret) CacheCleanUtility.ClearCache(groupIds: string.IsNullOrEmpty(p.Id) ? new List() : new List() { p.Id });
return ret;
diff --git a/Bootstrap.DataAccess/Helper/LogHelper.cs b/Bootstrap.DataAccess/Helper/LogHelper.cs
index 394e16c7..1bef5919 100644
--- a/Bootstrap.DataAccess/Helper/LogHelper.cs
+++ b/Bootstrap.DataAccess/Helper/LogHelper.cs
@@ -34,7 +34,6 @@ namespace Bootstrap.DataAccess
///
public static bool Save(Log log)
{
- if (log.Id == string.Empty) log.Id = null;
log.LogTime = DateTime.Now;
return DbContextManager.Create().Save(log);
}
diff --git a/Bootstrap.DataAccess/Helper/LoginHelper.cs b/Bootstrap.DataAccess/Helper/LoginHelper.cs
index 430eafbb..bbd19c9d 100644
--- a/Bootstrap.DataAccess/Helper/LoginHelper.cs
+++ b/Bootstrap.DataAccess/Helper/LoginHelper.cs
@@ -18,7 +18,6 @@ namespace Bootstrap.DataAccess
///
public static bool Log(LoginUser user)
{
- if (user.Id == string.Empty) user.Id = null;
if (string.IsNullOrEmpty(user.UserName)) user.UserName = user.Ip;
return DbContextManager.Create().Log(user);
}
diff --git a/Bootstrap.DataAccess/Helper/MenuHelper.cs b/Bootstrap.DataAccess/Helper/MenuHelper.cs
index 22ceba03..aca1d932 100644
--- a/Bootstrap.DataAccess/Helper/MenuHelper.cs
+++ b/Bootstrap.DataAccess/Helper/MenuHelper.cs
@@ -32,7 +32,6 @@ namespace Bootstrap.DataAccess
// 不允许保存系统菜单与前台演示系统的默认菜单
if (DictHelper.RetrieveSystemModel() && (p.Category == "0" || p.Application == "2")) return true;
- if (p.Id == string.Empty) p.Id = null;
var ret = DbContextManager.Create