Class Enhancing.Enhancer<TEnhancement>
Wrap and unwrap the instances of model classes with enhancement.
Inheritance
Inherited Members
Namespace: AasCore.Aas3_0_RC02
Assembly: AasCore.Aas3_0_RC02.dll
Syntax
public class Enhancer<TEnhancement>
where TEnhancement : class
Type Parameters
| Name | Description |
|---|---|
| TEnhancement | type of the enhancement |
Constructors
| Improve this Doc View SourceEnhancer(Func<IClass, TEnhancement>)
Declaration
public Enhancer(Func<IClass, TEnhancement> enhancementFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Func<IClass, TEnhancement> | enhancementFactory | how to enhance the instances. If it returns |
Methods
| Improve this Doc View SourceMustUnwrap(IClass)
Unwrap the given model instance.
Declaration
public TEnhancement MustUnwrap(IClass that)
Parameters
| Type | Name | Description |
|---|---|---|
| IClass | that | model instance to be unwrapped |
Returns
| Type | Description |
|---|---|
| TEnhancement | Enhancement wrapped around |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when |
Unwrap(IClass)
Unwrap the given model instance.
Declaration
public TEnhancement Unwrap(IClass that)
Parameters
| Type | Name | Description |
|---|---|---|
| IClass | that | model instance to be unwrapped |
Returns
| Type | Description |
|---|---|
| TEnhancement | Enhancement, or |
Wrap(IClass)
Wrap the instance with an enhancement.
Declaration
public IClass Wrap(IClass that)
Parameters
| Type | Name | Description |
|---|---|---|
| IClass | that | model instance to be wrapped |
Returns
| Type | Description |
|---|---|
| IClass |
|
Remarks
Double wraps are not allowed to prevent runtime leakage.
If you use references to the instance objects, you have to update them after the wrapping, as the wrapping is recursive.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when |