Skip to content

Commit

Permalink
Update DefaultDynamicLinqCustomTypeProvider constructor to be compati…
Browse files Browse the repository at this point in the history
…ble with microsoft/RulesEngine (#833)

* Update DefaultDynamicLinqCustomTypeProvider to make ParsingConfig optional

* Obsolete
  • Loading branch information
StefH committed Jul 29, 2024
1 parent 9dba825 commit 06610fb
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,24 @@ public class DefaultDynamicLinqCustomTypeProvider : AbstractDynamicLinqCustomTyp
private HashSet<Type>? _cachedCustomTypes;
private Dictionary<Type, List<MethodInfo>>? _cachedExtensionMethods;

/// <summary>
/// Initializes a new instance of the <see cref="DefaultDynamicLinqCustomTypeProvider"/> class.
/// Backwards compatibility for issue https://github.com/zzzprojects/System.Linq.Dynamic.Core/issues/830.
/// </summary>
/// <param name="cacheCustomTypes">Defines whether to cache the CustomTypes (including extension methods) which are found in the Application Domain. Default set to 'true'.</param>
[Obsolete("Please use the DefaultDynamicLinqCustomTypeProvider(ParsingConfig config, bool cacheCustomTypes = true) constructor.")]
public DefaultDynamicLinqCustomTypeProvider(bool cacheCustomTypes = true) : this(ParsingConfig.Default, cacheCustomTypes)
{
}

/// <summary>
/// Initializes a new instance of the <see cref="DefaultDynamicLinqCustomTypeProvider"/> class.
/// </summary>
/// <param name="config">The parsing configuration.</param>
/// <param name="cacheCustomTypes">Defines whether to cache the CustomTypes (including extension methods) which are found in the Application Domain. Default set to 'true'.</param>
public DefaultDynamicLinqCustomTypeProvider(ParsingConfig config, bool cacheCustomTypes = true)
{
_assemblyHelper = new DefaultAssemblyHelper(config);
_assemblyHelper = new DefaultAssemblyHelper(Check.NotNull(config));
_cacheCustomTypes = cacheCustomTypes;
}

Expand Down

0 comments on commit 06610fb

Please sign in to comment.