Class DefaultDynamicLinqCustomTypeProvider
The default implementation for DefaultDynamicLinqCustomTypeProvider.
Scans the current AppDomain for all types marked with DynamicLinqTypeAttribute, and adds them as custom Dynamic Link types.
Also provides functionality to resolve a Type in the current Application Domain.
This class is used as default for full .NET Framework and .NET Core App 2.x and higher.
Inheritance
Inherited Members
Namespace: System.Linq.Dynamic.Core.CustomTypeProviders
Assembly: System.Linq.Dynamic.Core.dll
Syntax
public class DefaultDynamicLinqCustomTypeProvider : AbstractDynamicLinqCustomTypeProvider, IDynamicLinkCustomTypeProvider, IDynamicLinqCustomTypeProvider
Constructors
| Improve this Doc View SourceDefaultDynamicLinqCustomTypeProvider(Boolean)
Initializes a new instance of the DefaultDynamicLinqCustomTypeProvider class. Backwards compatibility for issue https://github.com/zzzprojects/System.Linq.Dynamic.Core/issues/830.
Declaration
[Obsolete("Please use the DefaultDynamicLinqCustomTypeProvider(ParsingConfig config, bool cacheCustomTypes = true) constructor.")]
public DefaultDynamicLinqCustomTypeProvider(bool cacheCustomTypes = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | cacheCustomTypes | Defines whether to cache the CustomTypes (including extension methods) which are found in the Application Domain. Default set to 'true'. |
DefaultDynamicLinqCustomTypeProvider(ParsingConfig, Boolean)
Initializes a new instance of the DefaultDynamicLinqCustomTypeProvider class.
Declaration
public DefaultDynamicLinqCustomTypeProvider(ParsingConfig config, bool cacheCustomTypes = true)
Parameters
Type | Name | Description |
---|---|---|
ParsingConfig | config | The parsing configuration. |
System.Boolean | cacheCustomTypes | Defines whether to cache the CustomTypes (including extension methods) which are found in the Application Domain. Default set to 'true'. |
Methods
| Improve this Doc View SourceGetCustomTypes()
Returns a list of custom types that System.Linq.Dynamic.Core will understand.
Declaration
public virtual HashSet<Type> GetCustomTypes()
Returns
Type | Description |
---|---|
System.Collections.Generic.HashSet<System.Type> | A System.Collections.Generic.HashSet<T> list of custom types. |
GetExtensionMethods()
Returns a list of custom extension methods that System.Linq.Dynamic.Core will understand.
Declaration
public Dictionary<Type, List<MethodInfo>> GetExtensionMethods()
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Type, System.Collections.Generic.List<System.Reflection.MethodInfo>> | A list of custom extension methods that System.Linq.Dynamic.Core will understand. |
ResolveType(String)
Resolve any type by fullname which is registered in the current application domain.
Declaration
public Type ResolveType(string typeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | The typename to resolve. |
Returns
Type | Description |
---|---|
System.Type | A resolved System.Type or null when not found. |
ResolveTypeBySimpleName(String)
Resolve any type by the simple name which is registered in the current application domain.
Declaration
public Type ResolveTypeBySimpleName(string simpleTypeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | simpleTypeName | The typename to resolve. |
Returns
Type | Description |
---|---|
System.Type | A resolved System.Type or null when not found. |