static Regex GetSearchExpression(string searchText) { if (!SearchExpressions.ContainsKey(searchText)) { SearchExpressions[searchText] = new Regex(Regex.Escape(searchText), RegexOptions.IgnoreCase); } return(SearchExpressions[searchText]); }
public static void AddMoldsterConfiguratorControllers(this IMvcBuilder coll) { var ass = typeof(DomainsController).Assembly; coll.AddApplicationPart(ass) .AddControllersAsServices() .ConfigureApplicationPartManager(d => { d.FeatureProviders.Add(new ConfiguratorFeatureProvider()); }); SearchExpressions.RegisterExpressions(); }
/// <summary> /// Test the input expression supported or not. /// </summary> /// <param name="expression">The input expression</param> /// <returns>True/false.</returns> public bool IsUnsupportedExpressions(SearchExpressions expression) { if (UnsupportedExpressions == null || UnsupportedExpressions.Value == SearchExpressions.none) { return(false); } if ((UnsupportedExpressions.Value & expression) == expression) { return(true); } return(false); }
/// <summary> /// Expressions not supported in $search /// </summary> /// <param name="unsupportedExpressions">The value to set</param> /// <returns><see cref="SearchRestrictionsConfiguration"/></returns> public SearchRestrictionsConfiguration HasUnsupportedExpressions(SearchExpressions unsupportedExpressions) { _unsupportedExpressions = unsupportedExpressions; return(this); }