BJS.CRM.Framework
1.0.3
dotnet add package BJS.CRM.Framework --version 1.0.3
NuGet\Install-Package BJS.CRM.Framework -Version 1.0.3
<PackageReference Include="BJS.CRM.Framework" Version="1.0.3" />
<PackageVersion Include="BJS.CRM.Framework" Version="1.0.3" />
<PackageReference Include="BJS.CRM.Framework" />
paket add BJS.CRM.Framework --version 1.0.3
#r "nuget: BJS.CRM.Framework, 1.0.3"
#:package BJS.CRM.Framework@1.0.3
#addin nuget:?package=BJS.CRM.Framework&version=1.0.3
#tool nuget:?package=BJS.CRM.Framework&version=1.0.3
BJS.CRM.Framework
Explanation of the Sections
- Description: Provides an overview of what the package includes and what problems it solves.
- BasePlugin: An abstract class that simplifies Microsoft Dataverse plugin development by exposing key services and context data through a consistent interface
- Extensions: Important extensions
- Installation: Offers instructions on how to install the package using both NuGet Package Manager and .NET CLI.
- License: Links to the license file, informing users about the terms of use.
- Contributing: Encourages community involvement and contributions.
Description
BJS.CRM.Framework is a NuGet package that provides a collection of useful extensions for Dynamics CRM development and common C# tasks.
These extensions simplify working with OrganizationService, Entity, etc. objects in Dynamics CRM,
as well as offering enhancements to standard C#.
BasePlugin
BasePlugin is an abstract class that implements the IPlugin interface and serves as a common foundation for writing Dataverse (CRM) plugins. It provides convenient access to commonly used plugin context elements, including:
ExecutionContext - The core execution context for the current plugin invocation.
TracingService - For logging traces visible in the Plugin Trace Log.
PreImage � Snapshot of the record before the operation.
PostImage � Snapshot of the record after the operation.
Target � The main entity being processed in the plugin.
TargetReference - A reference to the target entity (commonly used in Delete operations).
OrganizationServiceInitiatingUser � Service scoped to the user who initiated the plugin.
OrganizationServiceAdmin � Admin-level service with elevated privileges, if needed.
OrganizationServiceSystem - Service that runs under the System user context.
By inheriting from BasePlugin, developers can focus on business logic without manually extracting these components from the plugin context.
Extensions
ToJson Converts a Dataverse Entity to a JSON string. This is useful for transmitting entity data outside the platform.
string json = entity.ToJson();
ToCrmEntity Parses a JSON string back into a Dataverse Entity. Useful when receiving data from external sources or stored JSON formats.
Entity entity = CrmEntityJsonConverter.ToCrmEntity(json);
These methods simplify data exchange and help with serialization in plugin development or integrations.
Note:
The ToCrmEntity() method expects the JSON to be in the exact structure returned by ToJson().
Do not modify the JSON structure manually or use arbitrary JSON formats.
Installation
You can install this package via NuGet Package Manager or the .NET CLI:
NuGet Package Manager
Install-Package BJS.CRM.Framework -Version {version_number}
.NET CLI
dotnet add package BJS.CRM.Framework --version {version_number}
License
This project is licensed under the MIT License. See the LICENSE.txt file for details.
Contributing
I will make it available for public contribution for any features, bug fixes, or improvements.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- Microsoft.CrmSdk.CoreAssemblies (>= 9.0.2.56)
- Microsoft.CSharp (>= 4.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.