Moved added method from PetaPoco file to an extension method
This commit is contained in:
@@ -2309,11 +2309,6 @@ namespace Umbraco.Core.Persistence
|
||||
return Append(new Sql("ORDER BY " + String.Join(", ", (from x in columns select x.ToString()).ToArray())));
|
||||
}
|
||||
|
||||
public Sql OrderByDescending(params object[] columns)
|
||||
{
|
||||
return Append(new Sql("ORDER BY " + String.Join(", ", (from x in columns select x.ToString() + " DESC").ToArray())));
|
||||
}
|
||||
|
||||
public Sql Select(params object[] columns)
|
||||
{
|
||||
return Append(new Sql("SELECT " + String.Join(", ", (from x in columns select x.ToString()).ToArray())));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using Umbraco.Core.Persistence.Querying;
|
||||
@@ -125,5 +126,10 @@ namespace Umbraco.Core.Persistence
|
||||
SqlSyntaxContext.SqlSyntaxProvider.GetQuotedColumnName(rightColumnName));
|
||||
return sql.On(onClause);
|
||||
}
|
||||
|
||||
public static Sql OrderByDescending(this Sql sql, params object[] columns)
|
||||
{
|
||||
return sql.Append(new Sql("ORDER BY " + String.Join(", ", (from x in columns select x.ToString() + " DESC").ToArray())));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user