mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-21 18:48:27 +08:00
Crosss database query
This commit is contained in:
@@ -718,6 +718,11 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (this.CrossQueryItems!=null&& this.CrossQueryItems.Count>0&&this.CrossQueryItems.ContainsKey(type.FullName))
|
||||||
|
{
|
||||||
|
var result= db.Root.GetConnection(this.CrossQueryItems[type.FullName]);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public ISugarQueryable<T> CrossQuery(Type type, string configId)
|
public ISugarQueryable<T> CrossQuery(Type type, string configId)
|
||||||
{
|
{
|
||||||
|
if (this.QueryBuilder.CrossQueryItems == null)
|
||||||
|
{
|
||||||
|
this.QueryBuilder.CrossQueryItems = new Dictionary<string, string>();
|
||||||
|
}
|
||||||
|
if(!this.QueryBuilder.CrossQueryItems.ContainsKey(type.FullName))
|
||||||
|
this.QueryBuilder.CrossQueryItems.Add(type.FullName, configId);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public ISugarQueryable<T> IncludeLeftJoin(Expression<Func<T, object>> LeftObject)
|
public ISugarQueryable<T> IncludeLeftJoin(Expression<Func<T, object>> LeftObject)
|
||||||
|
|||||||
Reference in New Issue
Block a user