Class ResolverBase<TResolver>
The base class for all resolvers.
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public abstract class ResolverBase<TResolver> : ResolverBase where TResolver : ResolverBase
Type Parameters
Name | Description |
---|---|
TResolver | The type of the concrete resolver class. |
Remarks
Provides singleton management to all resolvers.
Constructors
ResolverBase()
Constructor set the reset action for the underlying object
Declaration
protected ResolverBase()
Properties
Current
Gets or sets the resolver singleton instance.
Declaration
public static TResolver Current { get; set; }
Property Value
Type | Description |
---|---|
TResolver |
Remarks
The value can be set only once, and cannot be read before it has been set.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | value is read before it has been set, or value is set again once it has already been set. |
System.ArgumentNullException | value is |
HasCurrent
Gets a value indicating whether a the singleton instance has been set.
Declaration
public static bool HasCurrent { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Reset(Boolean)
Resets the resolver singleton instance to null.
Declaration
protected static void Reset(bool resetResolution = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | resetResolution | By default this is true because we always need to reset resolution before we reset a resolver, however in some insanely rare cases like unit testing you might not want to do this. |
Remarks
To be used in unit tests. DO NOT USE THIS DURING PRODUCTION.