mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-31 15:56:25 +08:00
Update InsertNav and UpdateNav
This commit is contained in:
parent
8016589653
commit
8c4f6ec766
@ -30,6 +30,8 @@ namespace SqlSugar
|
||||
.Where(it => it.PropertyName != mappingA.PropertyName)
|
||||
.Where(it => it.PropertyName != mappingB.PropertyName)
|
||||
.Where(it => !it.IsIdentity)
|
||||
.Where(it => !it.IsOnlyIgnoreInsert)
|
||||
.Where(it => !it.IsIgnore)
|
||||
.Where(it => !it.IsPrimarykey);
|
||||
Check.Exception(mappingA == null || mappingB == null, $"Navigate property {name} error ", $"导航属性{name}配置错误");
|
||||
List<Dictionary<string, object>> mappgingTables = new List<Dictionary<string, object>>();
|
||||
@ -51,7 +53,14 @@ namespace SqlSugar
|
||||
{
|
||||
if (!keyValuePairs.ContainsKey(pair.DbColumnName))
|
||||
{
|
||||
keyValuePairs.Add(pair.DbColumnName, UtilMethods.GetDefaultValue(pair.UnderType));
|
||||
if (pair.UnderType == UtilConstants.DateType)
|
||||
{
|
||||
keyValuePairs.Add(pair.DbColumnName, DateTime.Now);
|
||||
}
|
||||
else
|
||||
{
|
||||
keyValuePairs.Add(pair.DbColumnName, UtilMethods.GetDefaultValue(pair.UnderType));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,9 @@ namespace SqlSugar
|
||||
.Where(it => it.PropertyName != mappingA.PropertyName)
|
||||
.Where(it => it.PropertyName != mappingB.PropertyName)
|
||||
.Where(it=>!it.IsIdentity)
|
||||
.Where(it => !it.IsPrimarykey);
|
||||
.Where(it => !it.IsPrimarykey)
|
||||
.Where(it => !it.IsOnlyIgnoreInsert)
|
||||
.Where(it => !it.IsIgnore);
|
||||
Check.Exception(mappingA == null || mappingB == null, $"Navigate property {name} error ", $"导航属性{name}配置错误");
|
||||
List<Dictionary<string, object>> mappgingTables = new List<Dictionary<string, object>>();
|
||||
var ids=new List<object>();
|
||||
@ -61,7 +63,11 @@ namespace SqlSugar
|
||||
{
|
||||
foreach (var pair in mappingOthers)
|
||||
{
|
||||
if (!keyValuePairs.ContainsKey(pair.DbColumnName))
|
||||
if (pair.UnderType == UtilConstants.DateType)
|
||||
{
|
||||
keyValuePairs.Add(pair.DbColumnName, DateTime.Now);
|
||||
}
|
||||
else
|
||||
{
|
||||
keyValuePairs.Add(pair.DbColumnName, UtilMethods.GetDefaultValue(pair.UnderType));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user