Synchronization code

This commit is contained in:
sunkaixuan
2023-07-27 12:42:12 +08:00
parent 30ca507c8d
commit a934eee1ad

View File

@@ -1078,8 +1078,16 @@ namespace SqlSugar
}
public ISugarQueryable<T> OrderByPropertyName(string orderPropertyName, OrderByType? orderByType = null)
{
if (orderPropertyName != null)
if (orderPropertyName.HasValue())
{
if (orderPropertyName.Contains(","))
{
foreach (var item in orderPropertyName.Split(','))
{
this.OrderByPropertyName(item,orderByType);
}
return this;
}
if (this.Context.EntityMaintenance.GetEntityInfoWithAttr(typeof(T)).Columns.Any(it =>
it.DbColumnName?.EqualCase(orderPropertyName)==true
|| it.PropertyName?.EqualCase(orderPropertyName)==true))