ShipAsync.D365.Runtime 1.0.60

dotnet add package ShipAsync.D365.Runtime --version 1.0.60
                    
NuGet\Install-Package ShipAsync.D365.Runtime -Version 1.0.60
                    
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="ShipAsync.D365.Runtime" Version="1.0.60" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ShipAsync.D365.Runtime" Version="1.0.60" />
                    
Directory.Packages.props
<PackageReference Include="ShipAsync.D365.Runtime" />
                    
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 ShipAsync.D365.Runtime --version 1.0.60
                    
#r "nuget: ShipAsync.D365.Runtime, 1.0.60"
                    
#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 ShipAsync.D365.Runtime@1.0.60
                    
#: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=ShipAsync.D365.Runtime&version=1.0.60
                    
Install as a Cake Addin
#tool nuget:?package=ShipAsync.D365.Runtime&version=1.0.60
                    
Install as a Cake Tool

D365 Infrastructure Generator

A C# source generator for declaratively defining Dynamics 365 entities and fields using attributes.

Features

  • Declarative Infrastructure: Define D365 entities and fields using C# attributes
  • Source Generation: Automatically generates infrastructure creation code at compile time
  • Type Safety: Compile-time validation of entity and field configurations
  • Easy to Use: Simple attribute-based API
  • Full Field Support: Support for all D365 field types (text, number, currency, date, boolean, choice, lookup, etc.)

Installation

Option 1: Install the complete package (Recommended)

dotnet add package ShipAsync.D365.InfrastructureGenerator

This single package includes everything: attributes, source generator, and runtime.

Option 2: Install individual packages

If you need more control, install the packages separately:

dotnet add package ShipAsync.D365.Attributes
dotnet add package ShipAsync.D365.SourceGenerator
dotnet add package ShipAsync.D365.Runtime

Quick Start

1. Define Your Entity

using D365.Attributes.Entity;
using D365.Attributes.Fields;
using D365.Attributes.Common;

namespace MyApp.Entities;

[D365Entity("new_product", "Product", "Products",
    Description = "Product catalog entity",
    PrimaryFieldSchemaName = "new_name",
    PrimaryFieldDisplayName = "Product Name",
    OwnershipType = OwnershipType.UserOwned,
    HasActivities = true,
    Mode = OperationMode.Upsert)]
public partial class Product
{
    [TextField(
        SchemaName = "new_name",
        DisplayName = "Product Name",
        MaxLength = 100,
        RequiredLevel = RequiredLevel.ApplicationRequired,
        Order = 1)]
    public string? Name { get; set; }

    [CurrencyField(
        SchemaName = "new_unitprice",
        DisplayName = "Unit Price",
        Precision = 2,
        RequiredLevel = RequiredLevel.ApplicationRequired,
        Order = 2)]
    public decimal UnitPrice { get; set; }

    [BooleanField(
        SchemaName = "new_isactive",
        DisplayName = "Is Active",
        TrueLabel = "Active",
        FalseLabel = "Inactive",
        DefaultValue = true,
        Order = 3)]
    public bool IsActive { get; set; }
}

2. Generate Infrastructure

The source generator automatically creates a GenerateInfrastructure() method:

using D365.Runtime;

// Create a DynamicsTableCreator instance
var creator = new DynamicsTableCreator(
    baseUrl: "https://yourorg.crm.dynamics.com",
    accessToken: "your-access-token"
);

// Generate the infrastructure
var result = await Product.GenerateInfrastructure(creator);

if (result.IsSuccess)
{
    Console.WriteLine($"Entity created: {result.EntityCreated}");
    Console.WriteLine($"Fields created: {result.FieldsCreated}");
}
else
{
    foreach (var error in result.Errors)
    {
        Console.WriteLine($"Error: {error}");
    }
}

Supported Field Types

  • Text: Single-line text, email, phone, URL
  • MultiLineText: Multi-line text fields
  • Number: Whole number fields
  • Decimal: Decimal number fields
  • Currency: Currency fields
  • DateTime: Date and time fields
  • DateOnly: Date-only fields
  • Boolean: Two-option (Yes/No) fields
  • LocalChoice: Local option sets
  • GlobalChoice: Global option sets
  • Lookup: Relationship fields
  • File: File fields
  • Image: Image fields

Configuration Options

Entity Attributes

  • SchemaName: The logical name of the entity (e.g., "new_product")
  • DisplayName: The display name shown in UI
  • DisplayCollectionName: The plural display name
  • Description: Entity description
  • PrimaryFieldSchemaName: Schema name for the primary field
  • OwnershipType: UserOwned, TeamOwned, or OrganizationOwned
  • HasActivities: Enable activities (emails, tasks, appointments)
  • HasNotes: Enable notes and attachments
  • Mode: Create, Update, or Upsert

Field Attributes

Common properties for all field types:

  • SchemaName: The logical name of the field
  • DisplayName: The display name shown in UI
  • Description: Field description
  • RequiredLevel: None, Recommended, ApplicationRequired, or SystemRequired
  • Order: Display order in the generated code
  • Mode: Create, Update, or Upsert

Requirements

  • .NET 8.0 or later
  • C# 10.0 or later
  • Valid Dynamics 365 instance and access token

License

MIT License

Support

For issues and questions, please visit the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ShipAsync.D365.Runtime:

Package Downloads
ShipAsync.D365.InfrastructureGenerator

Complete package for Dynamics 365 declarative infrastructure generation. Install this single package to get attributes, source generator, and runtime - everything you need to define and create D365 entities using C# attributes.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.60 180 10/17/2025
1.0.58 189 10/17/2025