Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
namespace Helix.Skeleton.Foundation.Pages.Validators
{
using System;
using System.Runtime.Serialization;
using System.Web.Mvc;
using Base;
using Sitecore.Data.Validators;
using Sitecore.Data.Validators.FieldValidators;
[Serializable]
public class TemplateDependentRequiredValidator : RequiredFieldValidator
{
public TemplateDependentRequiredValidator() : base()
{
}
public TemplateDependentRequiredValidator(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
protected IBaseTemplateDependentValidator BaseTemplateDependentValidator
{
get
{
return DependencyResolver.Current.GetService<IBaseTemplateDependentValidator>();
}
}
protected override ValidatorResult Evaluate()
{
return this.BaseTemplateDependentValidator.Evaluate<RequiredFieldValidator>(
this,
() => base.Evaluate(),
() => this.GetItem());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment