public NotFoundError(string propertyName, object propertyValue, bool wildcardsEnabled) { Func <string, string, string> func = null; Func <string, string, string> func1 = null; Func <string, string, string> func2 = null; this.PropertyName = propertyName; this.PropertyValue = propertyValue; if (!wildcardsEnabled) { ClientSideQuery.NotFoundError notFoundError = this; if (func2 == null) { func2 = (string queryDescription, string className) => ClientSideQuery.NotFoundError.GetErrorMessageForNotFound_ForEquality(this.PropertyName, this.PropertyValue, className); } notFoundError.ErrorMessageGenerator = func2; return; } else { string str = propertyValue as string; if (str == null || !WildcardPattern.ContainsWildcardCharacters(str)) { ClientSideQuery.NotFoundError notFoundError1 = this; if (func1 == null) { func1 = (string queryDescription, string className) => ClientSideQuery.NotFoundError.GetErrorMessageForNotFound_ForEquality(this.PropertyName, this.PropertyValue, className); } notFoundError1.ErrorMessageGenerator = func1; return; } else { ClientSideQuery.NotFoundError notFoundError2 = this; if (func == null) { func = (string queryDescription, string className) => ClientSideQuery.NotFoundError.GetErrorMessageForNotFound_ForWildcard(this.PropertyName, this.PropertyValue, className); } notFoundError2.ErrorMessageGenerator = func; return; } } }
internal IEnumerable<ClientSideQuery.NotFoundError> GenerateNotFoundErrors() { if (this._filters.Count <= 1) { ClientSideQuery.CimInstanceFilterBase cimInstanceFilterBase = this._filters.SingleOrDefault<ClientSideQuery.CimInstanceFilterBase>(); if (cimInstanceFilterBase == null) { return Enumerable.Empty<ClientSideQuery.NotFoundError>(); } else { return cimInstanceFilterBase.GetNotFoundErrors_IfThisIsTheOnlyFilter(); } } else { if (this._numberOfMatchingResults <= 0) { List<ClientSideQuery.CimInstanceFilterBase> cimInstanceFilterBases = this._filters; if (!cimInstanceFilterBases.All<ClientSideQuery.CimInstanceFilterBase>((ClientSideQuery.CimInstanceFilterBase f) => !f.ShouldReportErrorOnNoMatches_IfMultipleFilters())) { ClientSideQuery.NotFoundError[] notFoundError = new ClientSideQuery.NotFoundError[1]; notFoundError[0] = new ClientSideQuery.NotFoundError(); return notFoundError; } else { return Enumerable.Empty<ClientSideQuery.NotFoundError>(); } } else { return Enumerable.Empty<ClientSideQuery.NotFoundError>(); } } }
internal IEnumerable <ClientSideQuery.NotFoundError> GenerateNotFoundErrors() { if (this._filters.Count <= 1) { ClientSideQuery.CimInstanceFilterBase cimInstanceFilterBase = this._filters.SingleOrDefault <ClientSideQuery.CimInstanceFilterBase>(); if (cimInstanceFilterBase == null) { return(Enumerable.Empty <ClientSideQuery.NotFoundError>()); } else { return(cimInstanceFilterBase.GetNotFoundErrors_IfThisIsTheOnlyFilter()); } } else { if (this._numberOfMatchingResults <= 0) { List <ClientSideQuery.CimInstanceFilterBase> cimInstanceFilterBases = this._filters; if (!cimInstanceFilterBases.All <ClientSideQuery.CimInstanceFilterBase>((ClientSideQuery.CimInstanceFilterBase f) => !f.ShouldReportErrorOnNoMatches_IfMultipleFilters())) { ClientSideQuery.NotFoundError[] notFoundError = new ClientSideQuery.NotFoundError[1]; notFoundError[0] = new ClientSideQuery.NotFoundError(); return(notFoundError); } else { return(Enumerable.Empty <ClientSideQuery.NotFoundError>()); } } else { return(Enumerable.Empty <ClientSideQuery.NotFoundError>()); } } }
public virtual IEnumerable <ClientSideQuery.NotFoundError> GetNotFoundErrors_IfThisIsTheOnlyFilter() { BehaviorOnNoMatch behaviorOnNoMatch = this.BehaviorOnNoMatch; switch (behaviorOnNoMatch) { case BehaviorOnNoMatch.Default: { return(Enumerable.Empty <ClientSideQuery.NotFoundError>()); } case BehaviorOnNoMatch.ReportErrors: { if (!this.HadMatches) { ClientSideQuery.NotFoundError[] notFoundError = new ClientSideQuery.NotFoundError[1]; notFoundError[0] = new ClientSideQuery.NotFoundError(); return(notFoundError); } else { return(Enumerable.Empty <ClientSideQuery.NotFoundError>()); } } case BehaviorOnNoMatch.SilentlyContinue: { return(Enumerable.Empty <ClientSideQuery.NotFoundError>()); } default: { return(Enumerable.Empty <ClientSideQuery.NotFoundError>()); } } }
public virtual IEnumerable<ClientSideQuery.NotFoundError> GetNotFoundErrors_IfThisIsTheOnlyFilter() { BehaviorOnNoMatch behaviorOnNoMatch = this.BehaviorOnNoMatch; switch (behaviorOnNoMatch) { case BehaviorOnNoMatch.Default: { return Enumerable.Empty<ClientSideQuery.NotFoundError>(); } case BehaviorOnNoMatch.ReportErrors: { if (!this.HadMatches) { ClientSideQuery.NotFoundError[] notFoundError = new ClientSideQuery.NotFoundError[1]; notFoundError[0] = new ClientSideQuery.NotFoundError(); return notFoundError; } else { return Enumerable.Empty<ClientSideQuery.NotFoundError>(); } } case BehaviorOnNoMatch.SilentlyContinue: { return Enumerable.Empty<ClientSideQuery.NotFoundError>(); } default: { return Enumerable.Empty<ClientSideQuery.NotFoundError>(); } } }