Vane.Mapper.DependencyInjection 1.0.0

Additional Details

第一版发布,还没有下载量,另外发现一个缺陷并进行修复,因此这个版本可以直接弃用

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

Vane.Mapper.DependencyInjection

NuGet License: MIT

Thin Microsoft.Extensions.DependencyInjection adapter for Vane.Mapper. The core package stays dependency-free; this package only registers the built IMapperRuntime as a singleton. Vane.Mapper 的 Microsoft.Extensions.DependencyInjection 薄适配。核心库保持零外部依赖;本包只负责把构建好的 IMapperRuntime 注册为单例。

Install / 安装

dotnet add package Vane.Mapper.DependencyInjection --version 1.0.0

Usage / 用法

using Vane.Mapping;
using Vane.Mapping.DependencyInjection;

services.AddVaneMapper(builder =>
{
    builder.Defaults(d => d.CopyMode(CopyMode.Deep));
    builder.Add<User, UserDto>(_ => { });
});

public sealed class UserService(IMapperRuntime runtime)
{
    public UserDto ToDto(User user) => runtime.Map<User, UserDto>(user);
}

After Build() only IMapperRuntime is registered — MappingEngine is never exposed as a container contract. Every AddVaneMapper call produces an independent runtime. Build() 后只注册 IMapperRuntime 单例,不暴露 MappingEngine;每次 AddVaneMapper 都得到独立 runtime。

With Vane.Container / 与 Vane.Container 一起用

ASP.NET Core with Vane.Container.AspNetCore's UseVaneContainer() still registers through this package's AddVaneMapper(...); VaneServiceProviderFactory translates the IServiceCollection descriptors into the Vane container. 使用 UseVaneContainer() 时仍由本包的 AddVaneMapper(...) 注册,VaneServiceProviderFactory 把 IServiceCollection 描述符翻译到 Vane 容器。

MIT, license text ships with the package · 文档:https://gitee.com/netcasewqs/Vane.Mapper/blob/master/docs/开发手册.md

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 is compatible.  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.1 0 12/6/2026
1.0.0 47 12/5/2026 1.0.0 is deprecated.

1.0.0:首个公开版本;命名空间 Vane.Mapping;支持 net8.0/net10.0;生成器包独立。详见 https://gitee.com/netcasewqs/Vane.Mapper/blob/master/docs/RELEASE-1.0.0.md