Digitall.Plugins.Registration.Source
3.0.0-beta.6
dotnet add package Digitall.Plugins.Registration.Source --version 3.0.0-beta.6
NuGet\Install-Package Digitall.Plugins.Registration.Source -Version 3.0.0-beta.6
<PackageReference Include="Digitall.Plugins.Registration.Source" Version="3.0.0-beta.6" />
<PackageVersion Include="Digitall.Plugins.Registration.Source" Version="3.0.0-beta.6" />
<PackageReference Include="Digitall.Plugins.Registration.Source" />
paket add Digitall.Plugins.Registration.Source --version 3.0.0-beta.6
#r "nuget: Digitall.Plugins.Registration.Source, 3.0.0-beta.6"
#:package Digitall.Plugins.Registration.Source@3.0.0-beta.6
#addin nuget:?package=Digitall.Plugins.Registration.Source&version=3.0.0-beta.6&prerelease
#tool nuget:?package=Digitall.Plugins.Registration.Source&version=3.0.0-beta.6&prerelease
Digitall.Plugins.Registration
NuGet package providing C# attributes for automated registration of Microsoft Dataverse plugin assemblies and workflow activities.
<p align="center"> <a href="LICENSE.md" target="_blank"> <img src="https://img.shields.io/github/license/DIGITALLNature/DigitallRegistrationPower.svg" alt="GitHub license"> </a> <a href="https://github.com/DIGITALLNature/DigitallRegistrationPower/releases" target="_blank"> <img src="https://img.shields.io/github/tag/DIGITALLNature/DigitallRegistrationPower.svg" alt="GitHub tag (latest SemVer)"> </a> <a href="https://www.nuget.org/packages/Digitall.Plugins.Registration" target="_blank"> <img src="https://img.shields.io/nuget/v/Digitall.Plugins.Registration" alt="NuGet"> </a> <a href="https://github.com/DIGITALLNature/DigitallRegistrationPower/graphs/contributors" target="_blank"> <img src="https://img.shields.io/github/contributors-anon/DIGITALLNature/DigitallRegistrationPower.svg" alt="GitHub contributors"> </a> </p>
Table of Contents
Installation
Choose one package depending on how you want the registration attributes to be delivered.
The binary package adds a reference to Digitall.Plugins.Registration.dll:
dotnet add package Digitall.Plugins.Registration
The source package compiles the attribute source files into your plugin assembly instead:
dotnet add package Digitall.Plugins.Registration.Source
The source files appear under the virtual Digitall.Plugins.Registration folder in the consuming project. They remain in the NuGet package cache and are not copied into the project directory.
For a project in a subdirectory:
dotnet add src/MyProject package Digitall.Plugins.Registration
Do not install both packages in the same project: both provide the same fully qualified types, which would cause duplicate type definitions. The source package targets .NET Standard 2.0 or higher and requires a C# 6.0-or-newer compiler. It only uses framework types and does not require a Dataverse SDK reference to compile the attributes.
If you repack the source package through another NuGet package, mark its package reference private so downstream consumers do not receive the source package transitively:
<PackageReference Include="Digitall.Plugins.Registration.Source" Version="x.y.z" PrivateAssets="all" />
Usage
Add using Digitall.Plugins.Registration; to your file and decorate your plugin or workflow class with the appropriate attribute. A registration tool can then discover and apply these annotations automatically.
PluginRegistration
Use [PluginRegistration] on classes that implement IPlugin for standard plugin step registration. Multiple attributes can be stacked on one class to register multiple steps.
Constructor parameters (mandatory):
| Parameter | Type | Description |
|---|---|---|
mode |
PluginExecutionMode |
Synchronous or Asynchronous |
messageName |
string |
Dataverse message (e.g. "Create", "Update") |
stage |
PluginExecutionStage |
Pipeline stage |
Optional named parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
PrimaryEntityName |
string |
null |
Logical name of the primary entity |
SecondaryEntityName |
string |
null |
Logical name of the secondary entity |
FilterAttributes |
string[] |
null |
Step only fires when at least one of these attributes changed |
ExecutionOrder |
int |
100 |
Rank among steps on the same message/stage |
PreEntityImage |
bool |
false |
Register a pre-entity image |
PreEntityImageAttributes |
string[] |
null |
Attributes for the pre-image; null = all |
PostEntityImage |
bool |
false |
Register a post-entity image |
PostEntityImageAttributes |
string[] |
null |
Attributes for the post-image; null = all |
using Digitall.Plugins.Registration;
[PluginRegistration(PluginExecutionMode.Asynchronous, "Create", PluginExecutionStage.PreOperation,
PrimaryEntityName = "account", ExecutionOrder = 10)]
[PluginRegistration(PluginExecutionMode.Synchronous, "Update", PluginExecutionStage.PostOperation,
PrimaryEntityName = "account",
FilterAttributes = new[] { "name" },
PreEntityImage = true, PreEntityImageAttributes = new[] { "name" })]
public class SamplePlugin : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
// ...
}
}
CustomApiRegistration
Use [CustomApiRegistration] on classes that implement IPlugin and act as the handler for a Custom API. Multiple attributes can be stacked.
| Parameter | Type | Description |
|---|---|---|
messageName |
string |
Message name of the Custom API |
using Digitall.Plugins.Registration;
[CustomApiRegistration("dgt_calc_vacations")]
public class CalcVacationsPlugin : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
// ...
}
}
CustomDataProviderRegistration
Use [CustomDataProviderRegistration] on classes that implement IPlugin to declare operation handlers for a custom data provider. Its constructor requires the data-source schema name, event, and provider name; optional metadata can be set with named properties. Stack one attribute per operation and use the same data-source schema name to group handlers into one provider.
The provider is identified by its data-source configuration table, not by a virtual table. One provider can serve multiple virtual tables.
Required constructor arguments
| Parameter | Type | Description |
|---|---|---|
dataSourceSchemaName |
string |
Publisher-prefixed schema name of the data-source configuration table; deployment key |
eventRegistration |
DataProviderEvent |
Operation handled by the decorated class |
providerName |
string |
Provider display name; explicitly supplied values set/update the name |
Optional properties
| Property | Type | Description |
|---|---|---|
DataSourceDisplayName |
string |
Singular label for the configuration table |
DataSourcePluralName |
string |
Plural label for the configuration table |
Description |
string |
Provider description |
using Digitall.Plugins.Registration;
[CustomDataProviderRegistration("dgt_CrmDataSource", DataProviderEvent.Create, "CRM Provider")]
[CustomDataProviderRegistration("dgt_CrmDataSource", DataProviderEvent.Update, "CRM Provider")]
public class HandleUpsertOnVirtualTable : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
// ...
}
}
The provider name is required on every declaration by the constructor; the registration tool can use the value from any declaration in the group. Optional string properties default to null. Omitted optional metadata preserves existing values: a declaration without optional metadata does not change existing table labels or descriptions. For first-time creation only, omitted table labels default to the schema name (singular) and the singular label plus " Records" (plural).
Registration-tool contract: This package supplies metadata only; it does not perform Dataverse registration or validation. A compatible dgtp release must:
- Validate required values before writes, reject
Unspecifiedand unknown events, and reject conflicting metadata or different classes claiming the same provider operation. - Resolve the schema name to the table's logical name and find the provider by
datasourcelogicalname; reject ambiguous provider matches. - Create/update the
EntityDataProviderrecord and assign registered plugin-type IDs to its operation fields, rather than creating ordinary SDK message-processing steps. - Preserve existing handlers for undeclared operations and preserve omitted optional metadata. Omission does not clear a value or remove a handler.
Creating or validating the provider's data-source configuration table belongs to the registration tool. The special table metadata and creation/reuse lifecycle must be verified before first-time provisioning is supported. Data-source records, custom configuration columns, virtual tables, and their mappings are outside this declaration's scope. Credentials must not be stored in attributes.
Breaking-change migration: The (string entityName, DataProviderEvent eventRegistration) constructor and EntityName property have been removed. Replace old declarations such as [CustomDataProviderRegistration("dgt_virtual_table", DataProviderEvent.Retrieve)] with the three-argument constructor shown above, selecting the provider's data-source schema name rather than copying the virtual-table name. Supply the provider name on each declaration and rebuild the plugin assembly. This API requires corresponding support in dgtp; legacy declarations must be rejected with migration guidance, not reinterpreted.
WorkflowRegistration
Use [WorkflowRegistration] on classes that derive from CodeActivity for workflow activity registration.
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
string |
— | Display name of the workflow activity |
group |
string |
"DGT" |
Group/category shown in the workflow designer |
includeVersion |
bool |
false |
Hint the registration tool to append the assembly version to the name |
using Digitall.Plugins.Registration;
[WorkflowRegistration("Sample", "SampleGroup")]
public class SampleWorkflow : CodeActivity
{
[Input(nameof(Email))]
[RequiredArgument]
[ReferenceTarget("email")]
public InArgument<EntityReference> Email { get; set; }
protected override void Execute(CodeActivityContext context)
{
// ...
}
}
API Reference
Attributes
| Attribute | Target | AllowMultiple | Description |
|---|---|---|---|
PluginRegistrationAttribute |
class |
✅ | Registers a plugin step |
CustomApiRegistrationAttribute |
class |
✅ | Registers a Custom API handler |
CustomDataProviderRegistrationAttribute |
class |
✅ | Declares a provider operation handler keyed by its data-source configuration table |
WorkflowRegistrationAttribute |
class |
❌ | Registers a workflow activity |
Enums
PluginExecutionMode
| Value | Int | Description |
|---|---|---|
Synchronous |
0 |
Executes synchronously in the pipeline |
Asynchronous |
1 |
Executes asynchronously via the async service |
PluginExecutionStage
| Value | Int | Description |
|---|---|---|
PreValidation |
10 |
Before the main database transaction |
PreOperation |
20 |
Within the transaction, before the core operation |
MainOperation |
30 |
The core platform operation |
PostOperation |
40 |
Within the transaction, after the core operation |
DataProviderEvent
| Value | Int | Description |
|---|---|---|
Unspecified |
-1 |
Default sentinel; invalid for deployment |
Retrieve |
0 |
Single-record retrieve |
RetrieveMultiple |
1 |
Multi-record retrieve |
Create |
2 |
Create operation |
Update |
3 |
Update operation |
Delete |
4 |
Delete operation |
Requirements
- .NET Standard 2.0 or higher
License
Released under the Microsoft Public License (MS-PL).
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-beta.6 | 85 | 11/12/2026 |
| 3.0.0-beta.5 | 123 | 11/12/2026 |