ValidationContext.ServiceContainer Property

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets the validation services container.

Namespace:   System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

public IServiceContainer ServiceContainer { get; }

Property Value

Type: System.ComponentModel.Design.IServiceContainer

The validation services container.

The ServiceContainer property is used for getting services during validation.

If the IServiceProvider provider that is specified in the constructor implements the IServiceContainer interface, the provider is used to initialize the ServiceContainer property. Otherwise the ServiceContainer property is initialized to an empty container.

.NET Framework
Available since 4.0
Return to top