Adds RequiredForPersistenceAttribute to easily detect if any entity fails validation in a way that it cannot be persisted to the data store. Changes all tree events to not be jquery events and to not require a 'callback' jquery object, instead we just use angular events broadcast globally, much nicer.

This commit is contained in:
Shannon
2013-07-18 17:05:40 +10:00
parent 17eb3db336
commit d3fe37a080
14 changed files with 139 additions and 315 deletions

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.ModelBinding;
namespace Umbraco.Core.Models.Validation
{
/// <summary>
/// A custom validation attribute which adds additional metadata to the property to indicate that
/// the value is required to be persisted.
/// </summary>
/// <remarks>
/// In Umbraco, we persist content even if it is invalid, however there are some properties that are absolutely required
/// in order to be persisted such as the Name of the content item. This attribute is re-usable to check for these types of
/// properties over any sort of model.
/// </remarks>
public class RequiredForPersistenceAttribute : RequiredAttribute
{
}
}