Rebel.Cms.Web.ModelStateExtensions.IsValid C# (CSharp) Method

IsValid() public static method

Checks if there are any model errors on any fields containing the prefix
public static IsValid ( this state, string prefix ) : bool
state this
prefix string
return bool
        public static bool IsValid(this ModelStateDictionary state, string prefix)
        {
            return state.Where(v => v.Key.StartsWith(prefix + ".")).All(v => !v.Value.Errors.Any());
        }