Fixes: U4-4368 Cannot insert the value NULL into column 'name' when creating new relation type from API

This commit is contained in:
Shannon
2014-03-17 13:21:17 +11:00
parent d1d54d8e84
commit f642a7fd63
4 changed files with 45 additions and 1 deletions

View File

@@ -21,9 +21,18 @@ namespace Umbraco.Core.Models
public RelationType(Guid childObjectType, Guid parentObjectType, string @alias)
{
Mandate.ParameterNotNullOrEmpty(@alias, "alias");
_childObjectType = childObjectType;
_parentObjectType = parentObjectType;
_alias = alias;
Name = _alias;
}
public RelationType(Guid childObjectType, Guid parentObjectType, string @alias, string name)
:this(childObjectType, parentObjectType, @alias)
{
Mandate.ParameterNotNullOrEmpty(name, "name");
Name = name;
}
private static readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<RelationType, string>(x => x.Name);