Asgard.Abstract 3.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Asgard.Abstract --version 3.0.0
                    
NuGet\Install-Package Asgard.Abstract -Version 3.0.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="Asgard.Abstract" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Asgard.Abstract" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Asgard.Abstract" />
                    
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 Asgard.Abstract --version 3.0.0
                    
#r "nuget: Asgard.Abstract, 3.0.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 Asgard.Abstract@3.0.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=Asgard.Abstract&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Asgard.Abstract&version=3.0.0
                    
Install as a Cake Tool

Asgard.Abstract

Asgard.Abstract 是 Asgard 框架的核心抽象层,提供了认证、缓存、数据库、日志、消息队列等基础组件的抽象接口定义。

项目结构

Asgard.Abstract/
├── Auth/                    # 认证相关抽象
│   └── AbsAuthManager.cs    # 认证管理器抽象基类
├── Cache/                   # 缓存相关抽象
│   ├── AbsCache.cs         # 缓存管理器抽象基类
│   └── CacheItemSettings.cs # 缓存项配置
├── DataBase/               # 数据库相关抽象
│   └── AbsDataBaseManager.cs # 数据库管理器抽象基类
├── Logger/                 # 日志相关抽象
│   ├── AbsLogger.cs        # 日志记录器抽象基类
│   └── AbsLoggerProvider.cs # 日志提供器抽象基类
├── MQ/                     # 消息队列相关抽象
│   ├── AbsMQManager.cs     # 消息队列管理器抽象基类
│   ├── MQHostInfo.cs       # 消息队列主机信息
│   └── MQItemOptions.cs    # 消息项配置选项
├── Models/                 # 模型定义
│   ├── AsgardConfig/       # 配置模型
│   └── AsgardUserInfo/     # 用户信息模型
└── AsgardContext.cs        # 核心上下文类

核心功能

认证管理 (Auth)

  • AbsAuthManager: JWT Token 的创建、解析和刷新功能的抽象接口
    • 支持 Token 创建与验证
    • 支持用户信息解析
    • 支持刷新 Token 生成

缓存管理 (Cache)

  • AbsCache: 统一缓存接口抽象
  • CacheItemSettings: 缓存项配置管理

数据库管理 (DataBase)

  • AbsDataBaseManager: 数据库操作的抽象接口

日志管理 (Logger)

  • AbsLogger: 日志记录器抽象接口
  • AbsLoggerProvider: 日志提供器抽象接口

消息队列 (MQ)

  • AbsMQManager: 消息队列管理抽象接口
  • MQHostInfo: 消息队列主机配置
  • MQItemOptions: 消息项配置选项

配置管理

提供完整的配置模型,包括:

  • 认证配置 (AuthConfig)
  • 配置中心 (ConfigCenterConfig)
  • 数据库配置 (DefaultDBConfig)
  • 分布式ID生成器 (IDWorker)
  • 消息队列配置 (MQConfig)
  • Redis配置 (RedisConfig)
  • 静态文件配置 (StaticFileConfig)
  • Web API配置 (WebApiConfig)
  • 日志配置 (LogConfig)

使用说明

本项目作为 Asgard 框架的抽象层,主要供具体实现项目引用。各模块的具体实现应继承相应的抽象类并实现其抽象方法。

开发规范

  • 所有抽象类必须使用 Abs 前缀命名
  • 提供完整的 XML 注释文档
  • 遵循单一职责原则
  • 接口设计应具有良好的扩展性

技术栈

  • .NET Standard
  • C# 10.0+
  • JWT 认证
  • 支持多种缓存实现
  • 支持多种消息队列

许可证

MIT License

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 (9)

Showing the top 5 NuGet packages that depend on Asgard.Abstract:

Package Downloads
Asgard.Hoenir

Asgard.Hoenir是一个轻量级、高性能的事件驱动消息总线系统,支持进程内通信和A2A(Agent-to-Agent)通信。基于现有事件总线架构,通过最小化修改实现A2A通信能力。

Asgard.DataBaseManager.FreeSql

Asgard.DataBaseManager.FreeSql 是Asgard框架基于Freesql这个ORM框架封装的数据库管理插件,也是Asgard推荐的ORM框架.

Asgard.Extends.AspNetCore

Asgard.Extends.AspNetCore 是Asgard框架对于Asp.Net core 的封装核心,是一个抽象与辅助函数对应的层

Asgard.Hosts.AspNetCore

Asgard.Hosts.AspNetCore 提供基于 ASP.NET Core 的宿主层实现,负责应用启动与依赖注入引导、通用中间件与管道配置、端点路由、gRPC 与 Swagger 集成,以及与 Asgard 框架模块(日志、配置、扩展等)的托管适配。兼容 .NET 8,面向可扩展的微服务与 Web 应用托管。

Asgard.Caches.Redis

Asgard.Caches.Redis 为阿斯加德框架提供基于 CSRedis 的缓存实现,针对 .NET 8 进行构建与兼容性优化。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0-preview.1 54 2/26/2026
3.1.9 258 1/16/2026
3.1.8 236 1/15/2026
3.1.7 341 12/22/2025
3.1.6 568 12/11/2025
3.1.5 361 12/7/2025
3.1.4 817 12/2/2025
3.1.2 411 11/30/2025
3.1.1 422 11/30/2025
3.1.0 370 11/22/2025
3.0.2 448 11/17/2025
3.0.1 361 11/14/2025
3.0.0 312 11/5/2025