Skip to content

Commit

Permalink
fixes relation type ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Apr 16, 2020
1 parent 0d7b0b9 commit b72abd5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Umbraco.Core/Models/RelationType.cs
Expand Up @@ -18,6 +18,7 @@ public class RelationType : EntityBase, IRelationType
private Guid? _parentObjectType;
private Guid? _childObjectType;

[Obsolete("This constructor is no longer used and will be removed in future versions, use one of the other constructors instead")]
public RelationType(string alias, string name)
: this(name, alias, false, null, null)
{
Expand All @@ -32,21 +33,25 @@ public RelationType(string name, string alias, bool isBidrectional, Guid? parent
_childObjectType = childObjectType;
}

[Obsolete("This constructor is incomplete, use one of the other constructors instead")]
[Obsolete("This constructor is no longer used and will be removed in future versions, use one of the other constructors instead")]
public RelationType(Guid childObjectType, Guid parentObjectType, string alias)
{
if (string.IsNullOrWhiteSpace(alias)) throw new ArgumentNullOrEmptyException(nameof(alias));
if (alias == null) throw new ArgumentNullException(nameof(alias));
if (string.IsNullOrWhiteSpace(alias)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(alias));

_childObjectType = childObjectType;
_parentObjectType = parentObjectType;
_alias = alias;
Name = _alias;
}

[Obsolete("This constructor is incomplete, use one of the other constructors instead")]
[Obsolete("This constructor is no longer used and will be removed in future versions, use one of the other constructors instead")]
public RelationType(Guid childObjectType, Guid parentObjectType, string alias, string name)
: this(childObjectType, parentObjectType, alias)
{
if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullOrEmptyException(nameof(name));
if (name == null) throw new ArgumentNullException(nameof(name));
if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(name));

Name = name;
}

Expand Down

0 comments on commit b72abd5

Please sign in to comment.