Update .net core version

This commit is contained in:
sunkaixuan
2022-06-07 16:15:54 +08:00
parent e9ce346e63
commit 03231f0912
2 changed files with 35 additions and 5 deletions

View File

@@ -171,7 +171,15 @@ namespace SqlSugar
{ {
return string.Empty; 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> /// <summary>
/// Gets the code annotation for the database table /// Gets the code annotation for the database table

View File

@@ -332,25 +332,35 @@ namespace SqlSugar
select new select new
{ {
l, l,
n n
}).GroupBy(it => it.l).ToList(); }).GroupBy(it => it.l).ToList();
foreach (var item in groupQuery) 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()) if (sqlObj.MappingExpressions.HasValue())
{ {
MappingFieldsHelper<T> helper = new MappingFieldsHelper<T>(); MappingFieldsHelper<T> helper = new MappingFieldsHelper<T>();
helper.NavEntity = navEntityInfo; helper.NavEntity = navEntityInfo;
helper.Context = this.Context; helper.Context = this.Context;
helper.RootEntity = this.Context.EntityMaintenance.GetEntityInfo<T>(); 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 else
{ {
var instance = Activator.CreateInstance(navObjectNamePropety.PropertyType, true); var instance = Activator.CreateInstance(navObjectNamePropety.PropertyType, true);
var ilist = instance as IList; var ilist = instance as IList;
foreach (var value in item.Select(it => it.n).ToList()) foreach (var value in itemSelectList.ToList())
{ {
ilist.Add(value); ilist.Add(value);
} }
@@ -525,6 +535,16 @@ namespace SqlSugar
var exp = method.Arguments[1]; var exp = method.Arguments[1];
oredrBy.Add(" " + queryable.QueryBuilder.GetExpressionValue(exp, ResolveExpressType.WhereSingle).GetString() + " DESC"); 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") else if (method.Method.Name == "ToList")
{ {
isList = true; isList = true;
@@ -594,6 +614,8 @@ namespace SqlSugar
public class SqlInfo public class SqlInfo
{ {
public int? Take { get; set; }
public int? Skip { get; set; }
public string WhereString { get; set; } public string WhereString { get; set; }
public string OrderByString { get; set; } public string OrderByString { get; set; }
public string SelectString { get; set; } public string SelectString { get; set; }