Skip to content

Commit

Permalink
Add back ctor to revert a breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
nul800sebastiaan committed Apr 15, 2020
1 parent d0eee32 commit 055f18d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Umbraco.Core/Models/RelationType.cs
@@ -1,5 +1,6 @@
using System;
using System.Runtime.Serialization;
using Umbraco.Core.Exceptions;
using Umbraco.Core.Models.Entities;

namespace Umbraco.Core.Models
Expand All @@ -17,8 +18,6 @@ public class RelationType : EntityBase, IRelationType
private Guid? _parentObjectType;
private Guid? _childObjectType;

//TODO: Should we put back the broken ctors with obsolete attributes?

public RelationType(string alias, string name)
: this(name, alias, false, null, null)
{
Expand All @@ -33,6 +32,15 @@ public RelationType(string name, string alias, bool isBidrectional, Guid? parent
_childObjectType = childObjectType;
}

[Obsolete("This constructor is incomplete, use one of the other constructors instead")]
public RelationType(Guid childObjectType, Guid parentObjectType, string alias)
{
if (string.IsNullOrWhiteSpace(alias)) throw new ArgumentNullOrEmptyException(nameof(alias));
_childObjectType = childObjectType;
_parentObjectType = parentObjectType;
_alias = alias;
Name = _alias;
}


/// <summary>
Expand Down

0 comments on commit 055f18d

Please sign in to comment.