SapphireLib.Validator 1.0.2

dotnet add package SapphireLib.Validator --version 1.0.2                
NuGet\Install-Package SapphireLib.Validator -Version 1.0.2                
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="SapphireLib.Validator" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SapphireLib.Validator --version 1.0.2                
#r "nuget: SapphireLib.Validator, 1.0.2"                
#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.
// Install SapphireLib.Validator as a Cake Addin
#addin nuget:?package=SapphireLib.Validator&version=1.0.2

// Install SapphireLib.Validator as a Cake Tool
#tool nuget:?package=SapphireLib.Validator&version=1.0.2                

项目目标

  • 单体应用的模块化应用框架。
  • 可直接投入生产环境使用。
  • 包含类库和架构两部分(以后会分开)。
  • 实现领域驱动设计。

模块

模块是项目的基础,项目中所有的功能点(业务或基础功能)都进行模块化。

已经创建的模块

基础模块
Authorization模块
  • 内置基于权限授权的处理器。
  • 超级管理员授权处理器。
  • 实现Jwt认证流程以及生成token服务。
  • todo
    • 基于资源的授权
Web主机模块

默认添加

  • ProblemDetails
  • Controller
  • ApiDocument(基于NSwag)
业务模块

业务模块包含的功能

  • CQRS
  • CQRSDecorator
  • Repository
  • EFCore
  • SqlSugar(开发中)
  • DomainEventBus
  • IntegrationEventBus
架构(设计规范)
  • 每个业务模块有自己的数据,模块间数据隔离。
  • 模块间共同需要通过集成事件,只能依赖其他模块的集成事件。
  • 对于简单的模块可以不分层,模块分层(如果需要)请参考一下
  • API API不包含业务逻辑,只通过Command或者Query与业务模块沟通。
  • Infrastructure 只包含模块需要的配置
  • Application 包含业务逻辑 Query中包含Sql语句直接访问数据库 Command中应通过仓储访问数据库 对外只暴露Command与Query,其他类型均应该为internal或者private
  • Repository 仓储实现具体的数据库操作逻辑,只依赖Domain。
  • Domain 定义业务对象

功能

模块可包含功能,功能必须添加于模块之中。

API

IModule

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SapphireLib.Validator:

Package Downloads
SapphireLib.CQRS.Decorator

Package Description

SapphireLib.Command

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 149 10/17/2024
1.0.1 623 5/7/2024
1.0.0 127 4/25/2024