mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 14:04:44 +08:00
Update .net core project
This commit is contained in:
parent
61b8f9456a
commit
46de9c4973
16
Src/Asp.NetCore2/SqlSugar/Entities/JoinInfoParameter.cs
Normal file
16
Src/Asp.NetCore2/SqlSugar/Entities/JoinInfoParameter.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SqlSugar
|
||||||
|
{
|
||||||
|
public class JoinInfoParameter
|
||||||
|
{
|
||||||
|
public string TableName { get; set; }
|
||||||
|
public string ShortName{ get; set; }
|
||||||
|
public IFuncModel Models { get; set; }
|
||||||
|
public JoinType Type { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -12,5 +12,6 @@ namespace SqlSugar
|
|||||||
ISugarQueryable<T> Select(List<SelectModel> models);
|
ISugarQueryable<T> Select(List<SelectModel> models);
|
||||||
ISugarQueryable<T> AS(string tableName, string shortName);
|
ISugarQueryable<T> AS(string tableName, string shortName);
|
||||||
ISugarQueryable<T> AddJoinInfo(string tableName, string shortName, IFuncModel models, JoinType type = JoinType.Left);
|
ISugarQueryable<T> AddJoinInfo(string tableName, string shortName, IFuncModel models, JoinType type = JoinType.Left);
|
||||||
|
ISugarQueryable<T> AddJoinInfo(List<JoinInfoParameter> joinInfoParameters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,17 @@ namespace SqlSugar
|
|||||||
this.QueryBuilder.Parameters.AddRange(sqlobj.Value);
|
this.QueryBuilder.Parameters.AddRange(sqlobj.Value);
|
||||||
return this.AddJoinInfo(tableName, shortName, sqlobj.Key, type);
|
return this.AddJoinInfo(tableName, shortName, sqlobj.Key, type);
|
||||||
}
|
}
|
||||||
|
public ISugarQueryable<T> AddJoinInfo(List<JoinInfoParameter> joinInfoParameters)
|
||||||
|
{
|
||||||
|
if (joinInfoParameters != null)
|
||||||
|
{
|
||||||
|
foreach (var item in joinInfoParameters)
|
||||||
|
{
|
||||||
|
this.AddJoinInfo(item.TableName,item.ShortName,item.Models,item.Type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
public ISugarQueryable<T> AS(string tableName, string shortName)
|
public ISugarQueryable<T> AS(string tableName, string shortName)
|
||||||
{
|
{
|
||||||
return this.AS($"{this.SqlBuilder.GetTranslationTableName(tableName)} {shortName}");
|
return this.AS($"{this.SqlBuilder.GetTranslationTableName(tableName)} {shortName}");
|
||||||
|
Loading…
Reference in New Issue
Block a user