Revert a C#8 fancy new switch as AzureDevOps does not like that

This commit is contained in:
Warren Buckley
2019-11-11 12:05:26 +00:00
parent 747cdcb5ee
commit dd1c8ec6a3

View File

@@ -516,11 +516,17 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
// TODO: although the default ordering string works for name, it wont work for others without a table or an alias of some sort
// As more things are attempted to be sorted we'll prob have to add more expressions here
var orderBy = ordering.OrderBy.ToUpperInvariant() switch
string orderBy;
switch (ordering.OrderBy.ToUpperInvariant())
{
"PATH" => SqlSyntax.GetQuotedColumn(NodeDto.TableName, "path"),
_ => ordering.OrderBy
};
case "PATH":
orderBy = SqlSyntax.GetQuotedColumn(NodeDto.TableName, "path");
break;
default:
orderBy = ordering.OrderBy;
break;
}
if (ordering.Direction == Direction.Ascending)
sql.OrderBy(orderBy);