Class PluginEventContext2<TEntity>
Plugin event context class
public class PluginEventContext2<TEntity> : EventContext, IPluginEventContext2<TEntity>, IPluginEventContext2, IBasePluginEventContext, IEventContext where TEntity : Entity
Type Parameters
TEntity
- Inheritance
-
PluginEventContext2<TEntity>
- Implements
-
IPluginEventContext2<TEntity>
- Inherited Members
Constructors
PluginEventContext2(string, PluginGeneralConfiguration, IServiceProvider)
Constructor that creates a tracing service logger.
public PluginEventContext2(string pluginName, PluginGeneralConfiguration generalConfig, IServiceProvider serviceProvider)
Parameters
pluginName
stringgeneralConfig
PluginGeneralConfigurationserviceProvider
IServiceProvider
Exceptions
PluginEventContext2(string, PluginGeneralConfiguration, IServiceProvider, IHslLogger)
Constrcutor that allows for a custom logger to be used.
public PluginEventContext2(string pluginName, PluginGeneralConfiguration generalConfig, IServiceProvider serviceProvider, IHslLogger logger)
Parameters
pluginName
stringgeneralConfig
PluginGeneralConfigurationserviceProvider
IServiceProviderlogger
IHslLogger
Exceptions
Properties
Logger
The logger
public IHslLogger Logger { get; init; }
Property Value
- IHslLogger
PluginContext
The context provided by the platform.
public IPluginExecutionContext PluginContext { get; }
Property Value
ServiceProvider
The service provider provided by the platform
public IServiceProvider ServiceProvider { get; }
Property Value
Targets
The list of Targets
public IReadOnlyList<ITargetItem<TEntity>> Targets { get; }
Property Value
- IReadOnlyList<ITargetItem<TEntity>>
TraceConfig
The configuration for tracing.
public PluginTraceConfiguration TraceConfig { get; }
Property Value
Methods
GetExecutionContext()
The execution context provided by the platform
protected override IExecutionContext GetExecutionContext()
Returns
Exceptions
GetOrganizationServiceFactory()
The organization service factory provided by the platform
protected override IOrganizationServiceFactory GetOrganizationServiceFactory()
Returns
Exceptions
GetParentContext(IExecutionContext)
Gets the parent context for the current context or null if there is none.
protected override IExecutionContext? GetParentContext(IExecutionContext ctx)
Parameters
Returns
GetSharedVariable<T>(string, bool, T?)
Gets a shared variable from the context.
public T? GetSharedVariable<T>(string name, bool includeParentContexts = true, T? defaultValue = default)
Parameters
Returns
- T
Type Parameters
T
GetTraceLog()
Gets the trace log. Requires that EnableGetTraceLog is set to true in the constructor.
public string? GetTraceLog()
Returns
Exceptions
GetTracingService()
The tracing service provided by the platform
protected override ITracingService GetTracingService()