Class RequiredForPersistenceAttribute
Specifies that a data field value is required in order to persist an object.
Inheritance
System.Object
System.Attribute
System.ComponentModel.DataAnnotations.ValidationAttribute
System.ComponentModel.DataAnnotations.RequiredAttribute
Namespace: Umbraco.Cms.Core.Models.Validation
Assembly: Umbraco.Core.dll
Syntax
public class RequiredForPersistenceAttribute : RequiredAttribute
Remarks
There are two levels of validation in Umbraco. (1) value validation is performed by IValueValidator instances; it can prevent a content item from being published, but not from being saved. (2) required validation of properties marked with RequiredForPersistenceAttribute; it does prevent an object from being saved and is used for properties that are absolutely mandatory, such as the name of a content item.
Methods
View SourceHasRequiredValuesForPersistence(Object)
Determines whether an object has all required values for persistence.
Declaration
public static bool HasRequiredValuesForPersistence(object model)
Parameters
Type | Name | Description |
---|---|---|
System.Object | model |
Returns
Type | Description |
---|---|
System.Boolean |