Class VisitorGroupValidator
Validates visitor groups in MVC
Inheritance
Namespace: EPiServer.Web.Mvc.VisitorGroups.Validation
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class VisitorGroupValidator : ModelValidator
Constructors
VisitorGroupValidator(ModelMetadata, ControllerContext)
Constructor that sends parameters to base class and sets the IVisitorGroupRepository to a instance of the default type
Declaration
public VisitorGroupValidator(ModelMetadata metadata, ControllerContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ModelMetadata | metadata | Provides a container for common metadata |
System.Web.Mvc.ControllerContext | context | Encapsulates information about an HTTP request |
VisitorGroupValidator(ModelMetadata, ControllerContext, IVisitorGroupRepository)
Constructor that sends parameters to base class and sets the IVisitorGroupRepository
Declaration
public VisitorGroupValidator(ModelMetadata metadata, ControllerContext context, IVisitorGroupRepository visitorGroupRepository)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ModelMetadata | metadata | Provides a container for common metadata |
System.Web.Mvc.ControllerContext | context | Encapsulates information about an HTTP request |
EPiServer.Personalization.VisitorGroups.IVisitorGroupRepository | visitorGroupRepository | Repository instance for the visitor group |
VisitorGroupValidator(ModelMetadata, ControllerContext, IVisitorGroupRepository, LocalizationService)
Constructor that sends parameters to base class and sets the IVisitorGroupRepository
Declaration
public VisitorGroupValidator(ModelMetadata metadata, ControllerContext context, IVisitorGroupRepository visitorGroupRepository, LocalizationService localizationService)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ModelMetadata | metadata | Provides a container for common metadata |
System.Web.Mvc.ControllerContext | context | Encapsulates information about an HTTP request |
EPiServer.Personalization.VisitorGroups.IVisitorGroupRepository | visitorGroupRepository | Repository instance for the visitor group |
LocalizationService | localizationService | The resource locator that should be used by the instance to get localized strings. |
VisitorGroupValidator(ModelMetadata, ControllerContext, IVisitorGroupRepository, VirtualRoleRepository<VirtualRoleProviderBase>, LocalizationService)
Initializes a new instance of the VisitorGroupValidator class.
Declaration
public VisitorGroupValidator(ModelMetadata metadata, ControllerContext context, IVisitorGroupRepository visitorGroupRepository, VirtualRoleRepository<VirtualRoleProviderBase> virtualRoleRepository, LocalizationService localizationService)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Mvc.ModelMetadata | metadata | |
System.Web.Mvc.ControllerContext | context | |
EPiServer.Personalization.VisitorGroups.IVisitorGroupRepository | visitorGroupRepository | |
VirtualRoleRepository<VirtualRoleProviderBase> | virtualRoleRepository | |
LocalizationService | localizationService |
Methods
Validate(Object)
Validates a visitor group in MVC
Declaration
public override IEnumerable<ModelValidationResult> Validate(object container)
Parameters
Type | Name | Description |
---|---|---|
System.Object | container | The data to validate |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Web.Mvc.ModelValidationResult> | Validation errors |