Msm.Workflow.Lib.Infrastructure 1.9.0

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

Msm.Workflow.Lib.Infrastructure

Infrastructure layer cho MSM Workflow Engine - chứa Entity Framework Core DbContext, configurations, và database access.

📦 Installation

<PackageReference Include="Msm.Workflow.Lib.Infrastructure" Version="1.0.0" />
dotnet add package Msm.Workflow.Lib.Infrastructure

📋 Overview

Package này cung cấp data access layer với Entity Framework Core và PostgreSQL support. Bao gồm DbContext, entity configurations, và migration support.

Contents

  • WorkflowDbContext: Main DbContext cho workflow entities
  • Entity Configurations: EF Core configurations cho tất cả entities
  • Multi-Tenancy Support: Schema-based multi-tenancy với PostgreSQL
  • Migrations: Database migration support

🎯 Usage

Register Services

using Msm.Workflow.Lib.Infrastructure;

// In Program.cs or Startup.cs
services.AddInfrastructure(configuration);

Configure DbContext

DbContext được đăng ký tự động bởi AddInfrastructure(). Nếu cần customize, bạn có thể override sau khi gọi AddInfrastructure().

// AddInfrastructure tự động đăng ký DbContext với connection string từ configuration
services.AddInfrastructure(configuration);

// Hoặc cung cấp connection string trực tiếp
services.AddInfrastructure(configuration, connectionString: "your-connection-string");

Multi-Tenancy

Package hỗ trợ schema-based multi-tenancy:

// Set tenant context
tenantProvider.SetCurrentTenantKey("tenant1");

// DbContext sẽ tự động sử dụng schema tương ứng
var processes = await context.WorkflowProcesses.ToListAsync();

🔗 Dependencies

  • Msm.Workflow.Lib.Domain (required)
  • Microsoft.EntityFrameworkCore (8.0.11)
  • Npgsql.EntityFrameworkCore.PostgreSQL (8.0.11)
  • Microsoft.Extensions.Configuration (9.0.0)
  • Msm.Workflow.Lib.Domain - Required dependency
  • Msm.Workflow.Lib.Application - Uses this package for data access

🗄️ Database Requirements

  • PostgreSQL 12+ (for multi-tenancy support)
  • Connection string format: Host=localhost;Port=5432;Database=msm_workflow;Username=postgres;Password=password

Migrations history table

Workflow DbContext dùng bảng riêng __WorkflowMigrationsHistory (trong mỗi schema tenant) thay vì __EFMigrationsHistory. Điều này tách hẳn migrations của Workflow khỏi host app (ví dụ SaleCore), tránh xung đột khi dùng chung database. Có thể tham chiếu WorkflowDbContext.MigrationsHistoryTableName trong code nếu cần.

📖 Documentation

For more information, see the main README.md and GETTING_STARTED.md.

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 is compatible.  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

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.9.0 77 3/5/2026
1.8.0 86 3/2/2026
1.6.0 128 1/11/2026
1.5.0 141 1/11/2026
1.4.0 126 1/11/2026
1.3.0 134 1/9/2026
1.2.0 129 1/7/2026
1.1.0 122 1/6/2026
1.0.0 109 1/6/2026