mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-16 04:59:34 +08:00
Update .net core version
This commit is contained in:
parent
e9ce346e63
commit
03231f0912
@ -171,7 +171,15 @@ namespace SqlSugar
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
return xeNode.Element("summary").Value.ToSqlFilter().Trim();
|
||||
var summary = xeNode.Element("summary");
|
||||
if (summary != null)
|
||||
{
|
||||
return summary.Value.ToSqlFilter().Trim();
|
||||
}
|
||||
else
|
||||
{
|
||||
return xeNode.Elements().Where(x=>x.Name.ToString().EqualCase("summary")).Select(it=>it.Value).FirstOrDefault().ToSqlFilter().Trim()??"";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the code annotation for the database table
|
||||
|
@ -336,21 +336,31 @@ namespace SqlSugar
|
||||
}).GroupBy(it => it.l).ToList();
|
||||
foreach (var item in groupQuery)
|
||||
{
|
||||
|
||||
var itemSelectList=item.Select(it => it.n);
|
||||
if (sqlObj.Skip != null)
|
||||
{
|
||||
itemSelectList = itemSelectList
|
||||
.Skip(sqlObj.Skip.Value);
|
||||
}
|
||||
if (sqlObj.Take != null)
|
||||
{
|
||||
itemSelectList = itemSelectList
|
||||
.Take(sqlObj.Take.Value);
|
||||
}
|
||||
if (sqlObj.MappingExpressions.HasValue())
|
||||
{
|
||||
MappingFieldsHelper<T> helper = new MappingFieldsHelper<T>();
|
||||
helper.NavEntity = navEntityInfo;
|
||||
helper.Context = this.Context;
|
||||
helper.RootEntity = this.Context.EntityMaintenance.GetEntityInfo<T>();
|
||||
helper.SetChildList(navObjectNameColumnInfo, item.Key, item.Select(it => it.n).ToList(), sqlObj.MappingExpressions);
|
||||
helper.SetChildList(navObjectNameColumnInfo, item.Key, itemSelectList.ToList(), sqlObj.MappingExpressions);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var instance = Activator.CreateInstance(navObjectNamePropety.PropertyType, true);
|
||||
var ilist = instance as IList;
|
||||
foreach (var value in item.Select(it => it.n).ToList())
|
||||
foreach (var value in itemSelectList.ToList())
|
||||
{
|
||||
ilist.Add(value);
|
||||
}
|
||||
@ -525,6 +535,16 @@ namespace SqlSugar
|
||||
var exp = method.Arguments[1];
|
||||
oredrBy.Add(" " + queryable.QueryBuilder.GetExpressionValue(exp, ResolveExpressType.WhereSingle).GetString() + " DESC");
|
||||
}
|
||||
else if (method.Method.Name == "Skip")
|
||||
{
|
||||
var exp = method.Arguments[1];
|
||||
result.Skip = (int)ExpressionTool.GetExpressionValue(exp);
|
||||
}
|
||||
else if (method.Method.Name == "Take")
|
||||
{
|
||||
var exp = method.Arguments[1];
|
||||
result.Take = (int)ExpressionTool.GetExpressionValue(exp);
|
||||
}
|
||||
else if (method.Method.Name == "ToList")
|
||||
{
|
||||
isList = true;
|
||||
@ -594,6 +614,8 @@ namespace SqlSugar
|
||||
|
||||
public class SqlInfo
|
||||
{
|
||||
public int? Take { get; set; }
|
||||
public int? Skip { get; set; }
|
||||
public string WhereString { get; set; }
|
||||
public string OrderByString { get; set; }
|
||||
public string SelectString { get; set; }
|
||||
|
Loading…
Reference in New Issue
Block a user