mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
43 lines
1.1 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Squidex.Domain.Apps.Core.ValidateContent
|
|
{
|
|
public static class ObjectPath
|
|
{
|
|
public static string ToPathString(this IEnumerable<string> path)
|
|
{
|
|
var sb = new StringBuilder();
|
|
|
|
var index = 0;
|
|
|
|
foreach (var property in path)
|
|
{
|
|
if (index == 0)
|
|
{
|
|
sb.Append(property);
|
|
}
|
|
else
|
|
{
|
|
if (property[0] != '[')
|
|
{
|
|
sb.Append('.');
|
|
}
|
|
|
|
sb.Append(property);
|
|
}
|
|
|
|
index++;
|
|
}
|
|
|
|
return sb.ToString();
|
|
}
|
|
}
|
|
}
|
|
|