Obsolete AddPropertyGroup without specifying alias

This commit is contained in:
Ronald Barendse
2021-07-14 10:31:58 +02:00
parent 74a56aadb7
commit 44caa0cf05
3 changed files with 11 additions and 23 deletions

View File

@@ -297,26 +297,12 @@ namespace Umbraco.Core.Models
/// <returns>Returns <c>True</c> if a PropertyType with the passed in alias exists, otherwise <c>False</c></returns>
public abstract bool PropertyTypeExists(string propertyTypeAlias);
/// <summary>
/// Adds a property group with the alias based on the name.
/// This method will also check if a group already exists with the same alias.
/// </summary>
/// <param name="groupName">Name of the PropertyGroup to add</param>
/// <returns>
/// Returns <c>True</c> if a PropertyGroup with the passed in name was added, otherwise <c>False</c>
/// </returns>
/// <inheritdoc />
[Obsolete("Use AddPropertyGroup(name, alias) instead to explicitly set the alias.")]
public abstract bool AddPropertyGroup(string groupName);
/// <summary>
/// Adds a PropertyGroup.
/// This method will also check if a group already exists with the same name and link it to the parent.
/// </summary>
/// <param name="groupName">Name of the PropertyGroup to add</param>
/// <param name="alias">The alias.</param>
/// <returns>
/// Returns <c>True</c> if a PropertyGroup with the passed in name was added, otherwise <c>False</c>
/// </returns>
public abstract bool AddPropertyGroup(string groupName, string alias);
/// <inheritdoc />
public abstract bool AddPropertyGroup(string name, string alias);
/// <summary>
/// Adds a PropertyType to a specific PropertyGroup

View File

@@ -206,15 +206,16 @@ namespace Umbraco.Core.Models
}
/// <inheritdoc />
[Obsolete("Use AddPropertyGroup(name, alias) instead to explicitly set the alias.")]
public override bool AddPropertyGroup(string groupName)
{
return AddAndReturnPropertyGroup(groupName, groupName.ToSafeAlias(true)) != null;
}
/// <inheritdoc />
public override bool AddPropertyGroup(string groupName, string alias)
public override bool AddPropertyGroup(string name, string alias)
{
return AddAndReturnPropertyGroup(groupName, alias) != null;
return AddAndReturnPropertyGroup(name, alias) != null;
}
private PropertyGroup AddAndReturnPropertyGroup(string name, string alias)

View File

@@ -154,12 +154,13 @@ namespace Umbraco.Core.Models
/// <remarks>
/// This method will also check if a group already exists with the same alias.
/// </remarks>
[Obsolete("Use AddPropertyGroup(name, alias) instead to explicitly set the alias.")]
bool AddPropertyGroup(string groupName);
/// <summary>
/// Adds a property group with the specified <paramref name="groupName" /> and <paramref name="alias" />.
/// Adds a property group with the specified <paramref name="name" /> and <paramref name="alias" />.
/// </summary>
/// <param name="groupName">Name of the group.</param>
/// <param name="name">Name of the group.</param>
/// <param name="alias">The alias.</param>
/// <returns>
/// Returns <c>true</c> if a property group with specified <paramref name="alias" /> was added; otherwise, <c>false</c>.
@@ -167,7 +168,7 @@ namespace Umbraco.Core.Models
/// <remarks>
/// This method will also check if a group already exists with the same alias.
/// </remarks>
bool AddPropertyGroup(string groupName, string alias);
bool AddPropertyGroup(string name, string alias);
/// <summary>
/// Moves a PropertyType to a specified PropertyGroup