OSharp.Plugin.Content
10.0.3
dotnet add package OSharp.Plugin.Content --version 10.0.3
NuGet\Install-Package OSharp.Plugin.Content -Version 10.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="OSharp.Plugin.Content" Version="10.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OSharp.Plugin.Content" Version="10.0.3" />
<PackageReference Include="OSharp.Plugin.Content" />
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 OSharp.Plugin.Content --version 10.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OSharp.Plugin.Content, 10.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 OSharp.Plugin.Content@10.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=OSharp.Plugin.Content&version=10.0.3
#tool nuget:?package=OSharp.Plugin.Content&version=10.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
OSharp.Plugin.Core
简洁的插件核心库,提供插件加载、注册与基础扩展点(示例库)。该包主要用于在 .NET 项目中集成插件机制与扩展点。
功能
- 插件发现与加载
- 插件生命周期管理
- 基础扩展点接口与示例实现
安装
从 NuGet 安装(替换为实际包名):
# 使用 dotnet CLI
dotnet add package OSharp.Plugin.Core --version x.y.z
# 使用 NuGet 包管理器控制台
Install-Package OSharp.Plugin.Core -Version x.y.z
using OSharp.Plugin.Core;
// 根据库的实际 API 调整以下示例
var manager = new PluginManager(); // 示例构造
manager.LoadPlugins("Plugins"); // 从指定目录加载插件
manager.InitializeAll();
OSharp.Plugin.Content
简要说明
OSharp.Plugin.Content 提供网站/应用的内容管理功能,包括文章、分类、标签、内容发布与富文本支持等。该插件封装了内容相关的数据模型、服务、控制器与事件处理,便于在 OSharp 平台中快速集成内容管理系统(CMS)能力。
主要功能
- 文章(Contents)管理:CRUD、发布/撤回、草稿管理
- 分类(Categories)与标签(Tags)管理
- 媒体/资源接口(如图片上传)
- 内容分页与检索(带基本过滤与排序)
- 内容事件(发布、下线)与钩子,支持扩展
目录结构(概要)
- Controllers/ —— 内容相关的控制器
- Dtos/ —— 数据传输对象
- Entities/ —— 实体类(Article、Category、Tag 等)
- Services/ —— 业务逻辑实现
- EntityConfiguration/ —— EF Core 实体映射配置
安装与引用
- 项目引用(推荐,本地开发调试)
# 在主项目目录执行
dotnet add reference ../Plugins/OSharp.Plugin.Content/OSharp.Plugin.Content.csproj
- NuGet(若已发布)
dotnet add package OSharp.Plugin.Content --version x.y.z
集成要点
数据库迁移 插件包含 EF Core 的实体配置,若使用主项目统一迁移策略,请将插件的 DbContext 或实体注册到主项目的迁移流程中,或单独为插件运行迁移:
dotnet ef migrations add InitContent --project Plugins/OSharp.Plugin.Content --startup-project Presentation/OSharp.Api dotnet ef database update --project Plugins/OSharp.Plugin.Content --startup-project Presentation/OSharp.Api控制器与服务 确保将插件程序集添加到 MVC 的 ApplicationPart,并在 DI 容器中注册插件服务:
services.AddApplicationPart(typeof(Startup).Assembly); // 替换为插件内类型 // 或调用插件提供的注册扩展方法 services.AddContentPlugin(Configuration);
配置
- 插件可能使用
appsettings.json中的节来配置上传路径、分页默认值等,请查看Settings/或以*Setting结尾的类。
开发与调试
- 先运行主项目,将插件以项目引用的方式加入解决方案,进行断点调试。
- 写单元测试时,优先对
Services/下的业务逻辑进行测试,可使用 InMemory EF Core 提供的DbContext进行模拟。
贡献与扩展
- 提交 Issue 或 PR;在 PR 中包含变更说明与必要的迁移脚本(如修改数据库模型)。
- 扩展点:可订阅插件发布事件来实现额外流程(例如通知、搜索索引更新)。
许可证
详见仓库根目录 LICENSE 文件。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.
-
net10.0
- OSharp.Authorization.Datas (>= 10.0.0)
- OSharp.Authorization.Functions (>= 10.0.0)
- OSharp.AutoMapper (>= 10.0.0)
- OSharp.Core (>= 10.0.0)
- OSharp.Identity (>= 10.0.0)
- OSharp.Plugin.Admin (>= 10.0.3)
- OSharp.Plugin.Core (>= 10.0.3)
- OSharp.Utils (>= 10.0.0)
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 |
|---|---|---|
| 10.0.3 | 29 | 1/23/2026 |
| 10.0.2 | 30 | 1/23/2026 |
| 10.0.1 | 32 | 1/23/2026 |
| 10.0.0 | 33 | 1/21/2026 |
| 8.2.1 | 441 | 12/9/2025 |
| 8.2.0 | 207 | 12/4/2025 |
| 8.1.9 | 415 | 11/20/2025 |
| 8.1.8 | 196 | 10/31/2025 |
| 8.1.7 | 199 | 10/27/2025 |
| 8.1.6 | 191 | 9/30/2025 |
| 8.1.5 | 194 | 9/24/2025 |
| 8.1.4 | 299 | 9/18/2025 |
| 8.1.3 | 329 | 9/18/2025 |
| 8.1.2 | 322 | 9/18/2025 |
| 8.1.1 | 211 | 9/3/2025 |