WIP Getting the content controller a bit further, now need to pull apart the content binder

This commit is contained in:
Shannon
2018-07-31 17:50:24 +10:00
parent 122c18e6d7
commit 9241e1fcda
8 changed files with 49 additions and 115 deletions

View File

@@ -376,30 +376,7 @@ namespace Umbraco.Core.Models
#endregion
#region Validation
/// <inheritdoc />
public bool IsValid(string culture = "*")
{
culture = culture.NullOrWhiteSpaceAsNull();
if (culture == null)
{
if (Name.IsNullOrWhiteSpace()) return false;
return ValidateProperties(null).Length == 0;
}
if (culture != "*")
{
var name = GetCultureName(culture);
if (name.IsNullOrWhiteSpace()) return false;
return ValidateProperties(culture).Length == 0;
}
// 'all cultures'
// those that have a name are ok, those without a name... we don't validate
return AvailableCultures.All(c => ValidateProperties(c).Length == 0);
}
/// <inheritdoc />
public virtual Property[] ValidateProperties(string culture = "*")
{