mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 04:23:47 +08:00
Synchronization code
This commit is contained in:
@@ -151,6 +151,10 @@ namespace SqlSugar
|
|||||||
/// <returns>the text contents of this XML element node</returns>
|
/// <returns>the text contents of this XML element node</returns>
|
||||||
public string GetXElementNodeValue(Type entityType, string nodeAttributeName)
|
public string GetXElementNodeValue(Type entityType, string nodeAttributeName)
|
||||||
{
|
{
|
||||||
|
if (this.Context.CurrentConnectionConfig?.MoreSettings?.IsNoReadXmlDescription == true)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
var path = entityType.Assembly.Location;
|
var path = entityType.Assembly.Location;
|
||||||
if (string.IsNullOrEmpty(path))
|
if (string.IsNullOrEmpty(path))
|
||||||
{
|
{
|
||||||
|
@@ -63,7 +63,14 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
Check.ExceptionEasy($"{name} no navigate attribute", $"{this._ParentEntity.EntityName}的属性{name}没有导航属性");
|
Check.ExceptionEasy($"{name} no navigate attribute", $"{this._ParentEntity.EntityName}的属性{name}没有导航属性");
|
||||||
}
|
}
|
||||||
UpdateRoot(isRoot, nav);
|
if (_RootOptions != null && _RootOptions.IsDisableUpdateRoot)
|
||||||
|
{
|
||||||
|
//Future
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UpdateRoot(isRoot, nav);
|
||||||
|
}
|
||||||
IsFirst = false;
|
IsFirst = false;
|
||||||
if (nav.Navigat.NavigatType == NavigateType.OneToOne || nav.Navigat.NavigatType == NavigateType.ManyToOne)
|
if (nav.Navigat.NavigatType == NavigateType.OneToOne || nav.Navigat.NavigatType == NavigateType.ManyToOne)
|
||||||
{
|
{
|
||||||
|
@@ -301,7 +301,24 @@ namespace SqlSugar
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
string sql = _ExecuteReturnIdentity();
|
string sql = _ExecuteReturnIdentity();
|
||||||
var result =await Ado.GetIntAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
var result = 0;
|
||||||
|
if (InsertBuilder.IsOleDb)
|
||||||
|
{
|
||||||
|
var isAuto = false;
|
||||||
|
if (this.Context.CurrentConnectionConfig.IsAutoCloseConnection)
|
||||||
|
{
|
||||||
|
isAuto = true;
|
||||||
|
this.Context.CurrentConnectionConfig.IsAutoCloseConnection = false;
|
||||||
|
}
|
||||||
|
result = Ado.GetInt(sql.Split(';').First(), InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||||
|
result = Ado.GetInt(sql.Split(';').Last(), InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||||
|
if (isAuto)
|
||||||
|
{
|
||||||
|
this.Ado.Close();
|
||||||
|
this.Context.CurrentConnectionConfig.IsAutoCloseConnection = isAuto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result =await Ado.GetIntAsync(sql, InsertBuilder.Parameters == null ? null : InsertBuilder.Parameters.ToArray());
|
||||||
After(sql, result);
|
After(sql, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -1019,8 +1019,8 @@ namespace SqlSugar
|
|||||||
public virtual ISugarQueryable<T> MergeTable()
|
public virtual ISugarQueryable<T> MergeTable()
|
||||||
{
|
{
|
||||||
Check.Exception(this.MapperAction != null || this.MapperActionWithCache != null,ErrorMessage.GetThrowMessage( "'Mapper’ needs to be written after ‘MergeTable’ ", "Mapper 只能在 MergeTable 之后使用"));
|
Check.Exception(this.MapperAction != null || this.MapperActionWithCache != null,ErrorMessage.GetThrowMessage( "'Mapper’ needs to be written after ‘MergeTable’ ", "Mapper 只能在 MergeTable 之后使用"));
|
||||||
Check.Exception(this.QueryBuilder.SelectValue.IsNullOrEmpty(),ErrorMessage.GetThrowMessage( "MergeTable need to use Queryable.Select Method .", "使用MergeTable之前必须要有Queryable.Select方法"));
|
//Check.Exception(this.QueryBuilder.SelectValue.IsNullOrEmpty(),ErrorMessage.GetThrowMessage( "MergeTable need to use Queryable.Select Method .", "使用MergeTable之前必须要有Queryable.Select方法"));
|
||||||
Check.Exception(this.QueryBuilder.Skip > 0 || this.QueryBuilder.Take > 0 || this.QueryBuilder.OrderByValue.HasValue(),ErrorMessage.GetThrowMessage( "MergeTable Queryable cannot Take Skip OrderBy PageToList ", "使用 MergeTable不能有 Take Skip OrderBy PageToList 等操作,你可以在Mergetable之后操作"));
|
//Check.Exception(this.QueryBuilder.Skip > 0 || this.QueryBuilder.Take > 0 || this.QueryBuilder.OrderByValue.HasValue(),ErrorMessage.GetThrowMessage( "MergeTable Queryable cannot Take Skip OrderBy PageToList ", "使用 MergeTable不能有 Take Skip OrderBy PageToList 等操作,你可以在Mergetable之后操作"));
|
||||||
var sqlobj = this._ToSql();
|
var sqlobj = this._ToSql();
|
||||||
var index = QueryBuilder.WhereIndex + 1;
|
var index = QueryBuilder.WhereIndex + 1;
|
||||||
var result = this.Context.Queryable<T>().AS(SqlBuilder.GetPackTable(sqlobj.Key, "MergeTable")).AddParameters(sqlobj.Value).Select("*").With(SqlWith.Null);
|
var result = this.Context.Queryable<T>().AS(SqlBuilder.GetPackTable(sqlobj.Key, "MergeTable")).AddParameters(sqlobj.Value).Select("*").With(SqlWith.Null);
|
||||||
|
@@ -17,5 +17,6 @@ namespace SqlSugar
|
|||||||
public int DefaultCacheDurationInSeconds { get; set; }
|
public int DefaultCacheDurationInSeconds { get; set; }
|
||||||
public bool? TableEnumIsString { get; set; }
|
public bool? TableEnumIsString { get; set; }
|
||||||
public DateTime? DbMinDate { get; set; } = Convert.ToDateTime("1900-01-01");
|
public DateTime? DbMinDate { get; set; } = Convert.ToDateTime("1900-01-01");
|
||||||
|
public bool IsNoReadXmlDescription { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,6 +27,7 @@ namespace SqlSugar
|
|||||||
public string[] IgnoreColumns { get; set; }
|
public string[] IgnoreColumns { get; set; }
|
||||||
public string[] UpdateColumns { get; set; }
|
public string[] UpdateColumns { get; set; }
|
||||||
public bool IsInsertRoot { get; set; }
|
public bool IsInsertRoot { get; set; }
|
||||||
|
public bool IsDisableUpdateRoot { get; set; }
|
||||||
public bool IsDiffLogEvent { get; set; }
|
public bool IsDiffLogEvent { get; set; }
|
||||||
public object DiffLogBizData { get; set; }
|
public object DiffLogBizData { get; set; }
|
||||||
}
|
}
|
||||||
|
@@ -173,7 +173,9 @@ namespace SqlSugar
|
|||||||
IsWithNoLockQuery = it.MoreSettings.IsWithNoLockQuery,
|
IsWithNoLockQuery = it.MoreSettings.IsWithNoLockQuery,
|
||||||
TableEnumIsString = it.MoreSettings.TableEnumIsString,
|
TableEnumIsString = it.MoreSettings.TableEnumIsString,
|
||||||
DisableMillisecond = it.MoreSettings.DisableMillisecond,
|
DisableMillisecond = it.MoreSettings.DisableMillisecond,
|
||||||
DbMinDate=it.MoreSettings.DbMinDate
|
DbMinDate=it.MoreSettings.DbMinDate,
|
||||||
|
IsNoReadXmlDescription=it.MoreSettings.IsNoReadXmlDescription
|
||||||
|
|
||||||
},
|
},
|
||||||
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
|
SqlMiddle = it.SqlMiddle == null ? null : new SqlMiddle
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user