Update .net core project

This commit is contained in:
sunkaixuan 2022-08-10 15:24:14 +08:00
parent 61b8f9456a
commit 46de9c4973
3 changed files with 28 additions and 0 deletions

View 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; }
}
}

View File

@ -12,5 +12,6 @@ namespace SqlSugar
ISugarQueryable<T> Select(List<SelectModel> models);
ISugarQueryable<T> AS(string tableName, string shortName);
ISugarQueryable<T> AddJoinInfo(string tableName, string shortName, IFuncModel models, JoinType type = JoinType.Left);
ISugarQueryable<T> AddJoinInfo(List<JoinInfoParameter> joinInfoParameters);
}
}

View File

@ -13,6 +13,17 @@ namespace SqlSugar
this.QueryBuilder.Parameters.AddRange(sqlobj.Value);
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)
{
return this.AS($"{this.SqlBuilder.GetTranslationTableName(tableName)} {shortName}");