Moved added method from PetaPoco file to an extension method

This commit is contained in:
AndyButland
2014-08-14 18:16:49 +02:00
parent beda0968ae
commit 53097a9b84
2 changed files with 6 additions and 5 deletions

View File

@@ -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())));

View File

@@ -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())));
}
}
}