diff --git a/src/System.Linq.Dynamic.Core/CustomTypeProviders/DefaultDynamicLinqCustomTypeProvider.cs b/src/System.Linq.Dynamic.Core/CustomTypeProviders/DefaultDynamicLinqCustomTypeProvider.cs index fc58ec0f..f69c9c49 100644 --- a/src/System.Linq.Dynamic.Core/CustomTypeProviders/DefaultDynamicLinqCustomTypeProvider.cs +++ b/src/System.Linq.Dynamic.Core/CustomTypeProviders/DefaultDynamicLinqCustomTypeProvider.cs @@ -22,6 +22,16 @@ public class DefaultDynamicLinqCustomTypeProvider : AbstractDynamicLinqCustomTyp private HashSet? _cachedCustomTypes; private Dictionary>? _cachedExtensionMethods; + /// + /// Initializes a new instance of the class. + /// Backwards compatibility for issue https://github.com/zzzprojects/System.Linq.Dynamic.Core/issues/830. + /// + /// Defines whether to cache the CustomTypes (including extension methods) which are found in the Application Domain. Default set to 'true'. + [Obsolete("Please use the DefaultDynamicLinqCustomTypeProvider(ParsingConfig config, bool cacheCustomTypes = true) constructor.")] + public DefaultDynamicLinqCustomTypeProvider(bool cacheCustomTypes = true) : this(ParsingConfig.Default, cacheCustomTypes) + { + } + /// /// Initializes a new instance of the class. /// @@ -29,7 +39,7 @@ public class DefaultDynamicLinqCustomTypeProvider : AbstractDynamicLinqCustomTyp /// Defines whether to cache the CustomTypes (including extension methods) which are found in the Application Domain. Default set to 'true'. public DefaultDynamicLinqCustomTypeProvider(ParsingConfig config, bool cacheCustomTypes = true) { - _assemblyHelper = new DefaultAssemblyHelper(config); + _assemblyHelper = new DefaultAssemblyHelper(Check.NotNull(config)); _cacheCustomTypes = cacheCustomTypes; }