Class PropertyValidationContext
Represents the context for property validation, including culture and segment information.
Inheritance
object
Namespace: Umbraco.Cms.Core.Models.Validation
Assembly: Umbraco.Core.dll
Syntax
public sealed class PropertyValidationContext
Constructors
View SourcePropertyValidationContext()
Declaration
public PropertyValidationContext()
Properties
View SourceCulture
Gets the culture being validated, or null for invariant validation.
Declaration
public required string? Culture { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
CulturesBeingValidated
Gets the collection of cultures being validated.
Declaration
public required IEnumerable<string> CulturesBeingValidated { get; init; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Segment
Gets the segment being validated, or null for neutral segment validation.
Declaration
public required string? Segment { get; init; }
Property Value
| Type | Description |
|---|---|
| string |
SegmentsBeingValidated
Gets the collection of segments being validated.
Declaration
public required IEnumerable<string?> SegmentsBeingValidated { get; init; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Methods
View SourceCultureAndSegment(string?, string?)
Creates a property validation context for a specific culture and segment.
Declaration
public static PropertyValidationContext CultureAndSegment(string? culture, string? segment)
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture | The culture to validate. |
| string | segment | The segment to validate. |
Returns
| Type | Description |
|---|---|
| PropertyValidationContext | A property validation context for the specified culture and segment. |
Empty()
Creates an empty property validation context with no culture or segment.
Declaration
public static PropertyValidationContext Empty()
Returns
| Type | Description |
|---|---|
| PropertyValidationContext | An empty property validation context. |