TASON.AspNetCore 0.10.0

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

包TASON.AspNetCore

该包提供了对ASP.NET Core的集成支持,包括MVC的模型绑定和响应序列化。

TASON的MIME类型为application/x-tason。配置好输入输出Formatters后,

  • Accept头设置为application/x-tason,即可使用TASON进行模型绑定。
  • Content-Type头设置为application/x-tason,即可使用TASON进行响应序列化。

快速开始

using Microsoft.Extensions.DependencyInjection;

var builder = WebApplication.CreateBuilder(args);


builder.Services.AddControllers()
  // 添加TASON支持
  .AddTason(options =>
  {
    // 配置SerializerOptions
    options.SerializerOptions.Indent = 2;
    // 向TypeRegistry注册额外的类型或者别名
    options.TypeRegistry.RegisterTypeAlias("MyTypeAlias", "MyType");
    // 配置自动注册的类型,例如返回所有的POCO类,要求这些类型有公共无参构造函数
    options.GetAutoRegisterObjectTypes = () =>
    {
      return Assembly
        .GetExecutingAssembly() 
        .GetExportedTypes()
        .Where(t => t.Name.EndsWith("Model"))
        .ToArray();
    }
  });

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

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
1.0.0 187 5/5/2025
1.0.0-preview.1 132 5/4/2025
0.11.2 113 4/19/2025
0.11.0 195 4/17/2025
0.10.0 196 4/15/2025