Galosys.Foundation.Orleans
26.5.20.1
dotnet add package Galosys.Foundation.Orleans --version 26.5.20.1
NuGet\Install-Package Galosys.Foundation.Orleans -Version 26.5.20.1
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="Galosys.Foundation.Orleans" Version="26.5.20.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Galosys.Foundation.Orleans" Version="26.5.20.1" />
<PackageReference Include="Galosys.Foundation.Orleans" />
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 Galosys.Foundation.Orleans --version 26.5.20.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Galosys.Foundation.Orleans, 26.5.20.1"
#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 Galosys.Foundation.Orleans@26.5.20.1
#: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=Galosys.Foundation.Orleans&version=26.5.20.1
#tool nuget:?package=Galosys.Foundation.Orleans&version=26.5.20.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Galosys.Foundation.Orleans
成熟度: 🟡 可用 — 功能完整,测试或文档可能不完善
Galosys.Foundation Orleans 分布式 Actor 框架集成模块,提供 Orleans 集群配置、存储提供器、仪表板监控及扩展方法。
功能概览
1. Orleans 配置管理
// 配置选项绑定到 appsettings.json
services.Configure<OrleansOptions>(configuration.GetSection("Orleans"));
2. 集群配置
// OrleansOptions 支持的集群配置
public ClusterOptions? Cluster { get; set; } = new ClusterOptions();
// 配置示例
{
"Orleans": {
"Cluster": {
"ServiceId": "MyService",
"ClusterId": "production"
}
}
}
3. ADO.NET 存储配置
// 配置 ADO.NET 存储
public OrleansAdoNetOptions? AdoNet { get; set; } = new OrleansAdoNetOptions
{
Invariant = "System.Data.SqlClient"
};
// 配置示例
{
"Orleans": {
"AdoNet": {
"ConnectionString": "Server=localhost;Database=Orleans;Trusted_Connection=true;",
"Invariant": "System.Data.SqlClient"
}
}
}
4. 仪表板监控
// 启用仪表板
public bool DashboardEnabled { get; set; } = false;
// 仪表板配置
public OrleansDashboardOptions Dashboard { get; set; } = new OrleansDashboardOptions
{
Port = 8081,
Host = "*",
HostSelf = true,
BasePath = "/orleans",
UserName = "orleans",
Password = "orleans"
};
// 配置示例
{
"Orleans": {
"DashboardEnabled": true,
"Dashboard": {
"Port": 8081,
"Host": "*",
"BasePath": "/orleans",
"UserName": "admin",
"Password": "securePassword"
}
}
}
5. 字符串扩展方法
// 检查字符串是否为空或默认值
var isEmpty = "".IsEmptyOrDefault(); // true
var isDefault = "default".IsEmptyOrDefault(); // true
var isCustom = "custom".IsEmptyOrDefault(); // false
// 自定义默认值
var isEmpty = "".IsEmptyOrDefault("N/A"); // true
var isDefault = "N/A".IsEmptyOrDefault("N/A"); // true
安装
<PackageReference Include="Galosys.Foundation.Orleans" Version="x.x.x" />
使用
配置 Orleans 服务
// 在 Program.cs 或 Startup.cs 中
builder.Services.AddOrleans(builder =>
{
builder.UseAzureClustering(options =>
{
options.ConnectionString = "your-connection-string";
});
// 或使用 ADO.NET 集群
builder.UseAdoNetClustering(options =>
{
options.Invariant = "System.Data.SqlClient";
options.ConnectionString = "your-connection-string";
});
});
配置 Orleans 仪表板
// 启用仪表板
builder.Services.AddOrleans(builder =>
{
builder.UseDashboard(options =>
{
options.Port = 8081;
options.Host = "*";
options.BasePath = "/orleans";
});
});
完整配置示例
{
"Orleans": {
"Cluster": {
"ServiceId": "MyService",
"ClusterId": "production"
},
"AdoNet": {
"ConnectionString": "Server=localhost;Database=Orleans;Trusted_Connection=true;",
"Invariant": "System.Data.SqlClient"
},
"DashboardEnabled": true,
"Dashboard": {
"Port": 8081,
"Host": "*",
"HostSelf": true,
"BasePath": "/orleans",
"UserName": "admin",
"Password": "securePassword"
}
}
}
核心类
| 分类 | 类 | 说明 |
|---|---|---|
| 配置 | OrleansOptions |
Orleans 主配置选项 |
| 配置 | OrleansAdoNetOptions |
ADO.NET 存储配置 |
| 配置 | OrleansDashboardOptions |
仪表板配置 |
| 扩展 | StringExtensions |
字符串扩展方法 |
目录结构
Galosys.Foundation.Orleans/
├── Microsoft/
│ └── Extensions/
│ └── Options/
│ └── OrleansOptions.cs # 配置选项类
└── System/
└── StringExtensions.cs # 字符串扩展方法
依赖
- Microsoft.Orleans.Sdk
- Microsoft.Orleans.Transactions
- Galosys.Foundation.Core
注意事项
- 集群配置:生产环境建议使用 Azure Clustering 或 ADO.NET Clustering
- 存储配置:确保数据库连接字符串正确配置
- 仪表板安全:生产环境应更改默认用户名和密码
- 扩展方法:
IsEmptyOrDefault扩展方法适用于验证 Orleans 标识符
| Product | Versions 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.
-
net8.0
- Galosys.Foundation.Core (>= 26.5.20.1)
- microsoft.orleans.sdk (>= 8.1.0)
- microsoft.orleans.transactions (>= 8.1.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Galosys.Foundation.Orleans:
| Package | Downloads |
|---|---|
|
Galosys.Foundation.Orleans.Client
Galosys.Foundation快速开发库 |
|
|
Galosys.Foundation.Orleans.Server
Galosys.Foundation快速开发库 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 26.5.20.1 | 133 | 5/20/2026 |
| 26.5.19.1 | 131 | 5/19/2026 |
| 26.5.18.1 | 125 | 5/18/2026 |
| 26.5.15.1 | 134 | 5/15/2026 |
| 26.5.12.3 | 128 | 5/12/2026 |
| 26.5.12.2 | 128 | 5/12/2026 |
| 26.4.27.1-rc1 | 131 | 4/26/2026 |
| 26.4.25.1-rc1 | 121 | 4/25/2026 |
| 26.4.22.2-rc7 | 122 | 4/22/2026 |
| 26.4.22.2-rc6 | 119 | 4/22/2026 |
| 26.4.22.2-rc4 | 117 | 4/22/2026 |
| 26.4.22.2-rc3 | 124 | 4/22/2026 |
| 26.4.19.1-rc1 | 124 | 4/19/2026 |
| 26.4.12.8-rc1 | 122 | 4/12/2026 |
| 26.4.12.7-rc1 | 124 | 4/12/2026 |
| 26.4.12.5-rc1 | 120 | 4/12/2026 |
| 26.1.30.1-rc1 | 150 | 1/30/2026 |
| 26.1.29.1 | 147 | 1/29/2026 |
| 26.1.28.5 | 144 | 1/28/2026 |
| 26.1.28.4 | 149 | 1/28/2026 |
Loading failed