Table of Contents

Class PluginBase2

Namespace
Hsl.Xrm.Sdk.Plugin
Assembly
Hsl.Xrm.Sdk.Plugin.dll

Base class for use with CreateMultiple or UpdateMultiple.

public abstract class PluginBase2 : IPlugin
Inheritance
PluginBase2
Implements
Derived
Inherited Members

Constructors

PluginBase2()

Default constructor

public PluginBase2()

PluginBase2(string?, string?)

Config constructor

public PluginBase2(string? unsecureConfig, string? secureConfig)

Parameters

unsecureConfig string
secureConfig string

Properties

EnableGetTraceLog

Set this to true in the constructor to enable the GetTraceLog() method.

public bool EnableGetTraceLog { get; init; }

Property Value

bool

Methods

CreateEventContext(PluginGeneralConfiguration, IServiceProvider)

Creates an instance of the PluginEventContext2. Can use override to have a custom class extending PluginEventContext2.

protected virtual IPluginEventContext2 CreateEventContext(PluginGeneralConfiguration generalConfig, IServiceProvider serviceProvider)

Parameters

generalConfig PluginGeneralConfiguration
serviceProvider IServiceProvider

Returns

IPluginEventContext2

Execute(IServiceProvider)

Executes the plugin. This is called by the platform.

public void Execute(IServiceProvider serviceProvider)

Parameters

serviceProvider IServiceProvider

Service provider for the plugin

ExecuteAction(IPluginEventContext2)

Executes the business logic of the plugin.

public abstract void ExecuteAction(IPluginEventContext2 pluginEventContext)

Parameters

pluginEventContext IPluginEventContext2

Context providing information about the plugin execution

LoadConfiguration(string?, string?)

Used to read/process the configuration. Note that this method is called before the derived class's constructor finishes.

protected virtual void LoadConfiguration(string? unsecureConfig, string? secureConfig)

Parameters

unsecureConfig string
secureConfig string

LoadGeneralConfiguration(string?, string?)

Reads the plugin trace configuration.

protected virtual PluginGeneralConfiguration LoadGeneralConfiguration(string? unsecureConfig, string? secureConfig)

Parameters

unsecureConfig string
secureConfig string

Returns

PluginGeneralConfiguration