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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BJS.CRM.Framework" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BJS.CRM.Framework" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="BJS.CRM.Framework" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BJS.CRM.Framework --version 1.0.3
                    
#r "nuget: BJS.CRM.Framework, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BJS.CRM.Framework@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BJS.CRM.Framework&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=BJS.CRM.Framework&version=1.0.3
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.3 242 6/23/2025
1.0.2 301 6/23/2025 1.0.2 is deprecated because it has critical bugs.
1.0.1 583 6/23/2025 1.0.1 is deprecated because it has critical bugs.
1.0.0 488 6/22/2025 1.0.0 is deprecated because it has critical bugs.