public virtual VerifyResult VerifyMany(IDictionary <string, object> keyValueCollections, bool withGlobalRules, string withGlobalProviderName = "") { if (ValidationHandler is null) { return(VerifyResult.Success); } var master = ValidationHandler.VerifyMany(_visitor.SourceType, keyValueCollections); var slave = withGlobalRules ? ValidationMe.Resolve(_visitor.SourceType, withGlobalProviderName).VerifyMany(_visitor.SourceType, keyValueCollections) : VerifyResult.Success; return(VerifyResult.Merge(master, slave)); }
public VerifyResult Verify(bool withGlobalRules, string withGlobalProviderName = "") { if (ValidationHandler is null) { return(VerifyResult.Success); } var master = ValidationHandler.Verify(_visitor.SourceType, _visitor.Instance); var slave = withGlobalRules ? ValidationMe.Resolve <T>(withGlobalProviderName).Verify(_visitor.Instance) : VerifyResult.Success; return(VerifyResult.Merge(master, slave)); }
public virtual VerifyResult VerifyOne(string memberName, object value, bool withGlobalRules, string withGlobalProviderName = "") { if (ValidationHandler is null) { return(VerifyResult.Success); } var master = ValidationHandler.VerifyOne(_visitor.SourceType, value, memberName); var slave = withGlobalRules ? ValidationMe.Resolve(_visitor.SourceType, withGlobalProviderName).VerifyOne(_visitor.SourceType, value, memberName) : VerifyResult.Success; return(VerifyResult.Merge(master, slave)); }
public VerifyResult VerifyOne(string memberName, bool withGlobalRules, string withGlobalProviderName = "") { if (ValidationHandler is null) { return(VerifyResult.Success); } var value = _visitor.ExposeLazyMemberHandler().Value.GetValueObject(memberName); var master = ValidationHandler.VerifyOne(_visitor.SourceType, value, memberName); var slave = withGlobalRules ? ValidationMe.Resolve <T>(withGlobalProviderName).VerifyOne(value, memberName) : VerifyResult.Success; return(VerifyResult.Merge(master, slave)); }
/// <summary> /// Resolve a validator based on a given type and name. /// </summary> /// <param name="name"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public IValidator <T> RequiredResolve <T>(string name) => Required(ValidationMe.Resolve <T>(name));
/// <summary> /// Resolve a validator based on a given type and name. /// </summary> /// <param name="type"></param> /// <param name="name"></param> /// <returns></returns> public IValidator RequiredResolve(Type type, string name) => Required(ValidationMe.Resolve(type, name));
/// <summary> /// Resolve a validator based on a given type. /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public IValidator <T> RequiredResolve <T>() => Required(ValidationMe.Resolve <T>());
/// <summary> /// Resolve a validator based on a given type. /// </summary> /// <param name="type"></param> /// <returns></returns> public IValidator RequiredResolve(Type type) => Required(ValidationMe.Resolve(type));
/// <summary> /// Resolve a validator based on a given type and name. /// </summary> /// <param name="name"></param> /// <typeparam name="T"></typeparam> /// <returns></returns> public IValidator <T> Resolve <T>(string name) => ValidationMe.Resolve <T>(name);
/// <summary> /// Resolve a validator based on a given type. /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public IValidator <T> Resolve <T>() => ValidationMe.Resolve <T>();
/// <summary> /// Resolve a validator based on a given type and name. /// </summary> /// <param name="type"></param> /// <param name="name"></param> /// <returns></returns> public IValidator Resolve(Type type, string name) => ValidationMe.Resolve(type, name);
/// <summary> /// Resolve a validator based on a given type. /// </summary> /// <param name="type"></param> /// <returns></returns> public IValidator Resolve(Type type) => ValidationMe.Resolve(type);