V16: Siblings endpoints (#19657)
* PoC implementation * Move to controller base * Implement solution that seems worse, but works better * Don't require parent key in repository method * Fix typos * Add siblings for data type, media type and media * Add endpoint for template * Add DocumentType and DocumentBlueprint controllers * Fix naming * Fix case if siblings are under root * Take item ordering into account not all entities are ordered by sort order * Add default implementation * Fix parentkey * Add tests * Format optimizations for split view * Add test covered requirement to description * Cover positive case and make test case output more readable * reduce allocations * Clarify test --------- Co-authored-by: Migaroez <geusens@gmail.com>
This commit is contained in:
@@ -1298,6 +1298,14 @@ namespace Umbraco.Extensions
|
||||
|
||||
#region Utilities
|
||||
|
||||
public static Sql<ISqlContext> AppendSubQuery(this Sql<ISqlContext> sql, Sql<ISqlContext> subQuery, string alias)
|
||||
{
|
||||
// Append the subquery as a derived table with an alias
|
||||
sql.Append("(").Append(subQuery.SQL, subQuery.Arguments).Append($") AS {alias}");
|
||||
|
||||
return sql;
|
||||
}
|
||||
|
||||
private static string[] GetColumns<TDto>(this Sql<ISqlContext> sql, string? tableAlias = null, string? referenceName = null, Expression<Func<TDto, object?>>[]? columnExpressions = null, bool withAlias = true, bool forInsert = false)
|
||||
{
|
||||
PocoData? pd = sql.SqlContext.PocoDataFactory.ForType(typeof (TDto));
|
||||
|
||||
Reference in New Issue
Block a user