internal void EnableGranularValidation(ValidateStringCallback validationCallback) { // Iterate over all the keys, adding each to the set containing the keys awaiting validation. // Unlike dictionaries, HashSet<T> can contain null keys, so don't need to special-case them. _keysAwaitingValidation = new HashSet <string>(Keys.Cast <string>(), StringComparer.OrdinalIgnoreCase); _validationCallback = validationCallback; }
/* * We added granular request validation in ASP.NET 4.5 to provide a better request validation story for our developers. * Instead of validating the entire collection ahead of time, we'll only validate entries that are actually looked at. */ internal void EnableGranularValidation(ValidateStringCallback validationCallback) { // Iterate over all the keys, adding each to the set containing the keys awaiting validation. // Unlike dictionaries, HashSet<T> can contain null keys, so don't need to special-case them. _keysAwaitingValidation = new HashSet<string>(Keys.Cast<string>().Where(KeyIsCandidateForValidation), StringComparer.OrdinalIgnoreCase); _validationCallback = validationCallback; // This forces CopyTo and other methods that cache entries to flush their caches, ensuring // that all values go through validation again. InvalidateCachedArrays(); }
/* * We added granular request validation in ASP.NET 4.5 to provide a better request validation story for our developers. * Instead of validating the entire collection ahead of time, we'll only validate entries that are actually looked at. */ internal void EnableGranularValidation(ValidateStringCallback validationCallback) { // Iterate over all the keys, adding each to the set containing the keys awaiting validation. // Unlike dictionaries, HashSet<T> can contain null keys, so don't need to special-case them. _keysAwaitingValidation = new HashSet <string>(Keys.Cast <string>().Where(KeyIsCandidateForValidation), StringComparer.OrdinalIgnoreCase); _validationCallback = validationCallback; // This forces CopyTo and other methods that cache entries to flush their caches, ensuring // that all values go through validation again. InvalidateCachedArrays(); }
internal void EnableGranularValidation(ValidateStringCallback validationCallback) { // Iterate over all the files, adding each to the set containing the files awaiting validation. // Unlike dictionaries, HashSet<T> can contain null keys, so don't need to special-case them. _filesAwaitingValidation = new HashSet <HttpPostedFile>(); for (int i = 0; i < Count; i++) { _filesAwaitingValidation.Add((HttpPostedFile)BaseGet(i)); } _validationCallback = validationCallback; }
internal void EnableGranularValidation(ValidateStringCallback validationCallback) { // Iterate over all the files, adding each to the set containing the files awaiting validation. // Unlike dictionaries, HashSet<T> can contain null keys, so don't need to special-case them. _filesAwaitingValidation = new HashSet<HttpPostedFile>(); for (int i = 0; i < Count; i++) { _filesAwaitingValidation.Add((HttpPostedFile)BaseGet(i)); } _validationCallback = validationCallback; }
internal void EnableGranularValidation(ValidateStringCallback validationCallback) { // Iterate over all the keys, adding each to the set containing the keys awaiting validation. // Unlike dictionaries, HashSet<T> can contain null keys, so don't need to special-case them. _keysAwaitingValidation = new HashSet<string>(Keys.Cast<string>(), StringComparer.OrdinalIgnoreCase); _validationCallback = validationCallback; }