Asgard.Abstract 3.1.9

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

Asgard.Abstract

Asgard.Abstract 是 Asgard 框架的核心抽象层,定义了所有关键组件的接口契约。它是框架可扩展性的基石,任何具体实现都必须遵循这些约定。

项目结构

Asgard.Abstract/
├── Auth/                    # 认证相关抽象
│   └── AbsAuthManager.cs    # JWT Token 管理的抽象基类
├── Cache/                   # 缓存相关抽象
│   ├── AbsCache.cs         # 统一缓存操作的抽象基类
│   └── CacheItemSettings.cs # 缓存项过期策略等配置
├── DataBase/               # 数据库相关抽象
│   └── AbsDataBaseManager.cs # 数据库会话与事务管理的抽象基类
├── Logger/                 # 日志相关抽象
│   ├── AbsLogger.cs        # 日志记录器的抽象基类
│   └── AbsLoggerProvider.cs # 日志提供器(如控制台、文件、数据库)的抽象基类
├── MQ/                     # 消息队列相关抽象
│   ├── AbsMQManager.cs     # 消息发布/订阅的抽象基类
│   ├── MQHostInfo.cs       # 消息队列主机连接信息
│   └── MQItemOptions.cs    # 消息持久化、重试等选项配置
├── Models/                 # 核心模型定义
│   ├── AsgardConfig/       # 包含所有系统模块的配置模型 (如 ConfigCenterConfig, WebApiConfig)
│   └── AsgardUserInfo/     # 用户认证信息模型
└── AsgardContext.cs        # 封装了当前运行时所需的所有服务实例 (DB, Logger, Cache 等) 的核心上下文

抽象接口详解

AbsBifrost - 系统入口点

所有宿主和插件的入口都必须继承此类。它定义了系统生命周期的关键方法:

  • OnSystemStarted(AsgardContext context): 系统完全启动后调用。
  • SystemTryShutDown(): 系统即将关闭时调用。

AsgardContext - 运行时上下文

这是一个至关重要的对象,它在系统启动时被创建,并作为参数传递给 OnSystemStarted 方法。它包含了对数据库、日志、缓存等服务的引用,是业务逻辑访问基础设施的统一入口。

开发规范

  • 命名: 所有抽象类和接口必须使用 Abs 前缀。
  • 职责: 遵循单一职责原则,每个抽象只负责一个明确的功能领域。
  • 扩展性: 接口设计应考虑未来可能的扩展,避免频繁修改。
  • 文档: 提供完整的 XML 文档注释。

许可证

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.
  • net8.0

    • No dependencies.

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 53 2/26/2026
3.1.9 257 1/16/2026
3.1.8 236 1/15/2026
3.1.7 340 12/22/2025
3.1.6 567 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 421 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