ZAnalyzers.Core
0.1.2
dotnet add package ZAnalyzers.Core --version 0.1.2
NuGet\Install-Package ZAnalyzers.Core -Version 0.1.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="ZAnalyzers.Core" Version="0.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZAnalyzers.Core" Version="0.1.2" />
<PackageReference Include="ZAnalyzers.Core" />
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 ZAnalyzers.Core --version 0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ZAnalyzers.Core, 0.1.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.
#:package ZAnalyzers.Core@0.1.2
#: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=ZAnalyzers.Core&version=0.1.2
#tool nuget:?package=ZAnalyzers.Core&version=0.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ZAnalyzers.Core
项目概述
ZAnalyzers.Core是ZAnalyzers系列的核心基础库,提供了基础类型和接口定义,用于支持其他ZAnalyzers组件(如ZAnalyzers.MinimalApiSG)的功能实现。
核心组件
FantasyApi
FantasyApi
是一个抽象基类,作为ZAnalyzers.MinimalApiSG代码生成器的基础标记类型。通过继承此类,您的服务类会被自动识别并处理为Minimal API端点。
namespace ZAnalyzers.Core
{
public abstract class FantasyApi
{
}
}
使用方法
ZAnalyzers.Core通常不需要单独使用,它主要作为ZAnalyzers其他组件的依赖项存在。在使用ZAnalyzers.MinimalApiSG或其他ZAnalyzers组件时,您需要同时引用ZAnalyzers.Core包。
安装
<PackageReference Include="ZAnalyzers.Core" Version="x.x.x" />
示例用法
创建继承自FantasyApi
的服务类:
using ZAnalyzers.Core;
namespace YourNamespace
{
public class UserService : FantasyApi
{
public async Task<User> GetUser(int id)
{
// 实现逻辑
return await Task.FromResult(new User { Id = id, Name = "Test User" });
}
}
}
与ZAnalyzers.MinimalApiSG的关系
- ZAnalyzers.Core提供基础类型定义
- ZAnalyzers.MinimalApiSG依赖ZAnalyzers.Core,并使用其中的类型进行代码生成
- 使用ZAnalyzers.MinimalApiSG时,必须同时引用ZAnalyzers.Core
详细的API使用说明,请参考ZAnalyzers.MinimalApiSG文档。
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.