chore: 构建稳定版本
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Mapster;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace Yi.Framework.Mapster
|
||||
{
|
||||
public class MapsterAutoObjectMappingProvider : IAutoObjectMappingProvider
|
||||
{
|
||||
public TDestination Map<TSource, TDestination>(object source)
|
||||
{
|
||||
var sss = typeof(TDestination).Name;
|
||||
return source.Adapt<TDestination>();
|
||||
}
|
||||
|
||||
public TDestination Map<TSource, TDestination>(TSource source, TDestination destination)
|
||||
{
|
||||
return source.Adapt<TSource, TDestination>(destination);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace Yi.Framework.Mapster
|
||||
{
|
||||
public class MapsterObjectMapper : IObjectMapper
|
||||
{
|
||||
public IAutoObjectMappingProvider AutoObjectMappingProvider => throw new NotImplementedException();
|
||||
|
||||
public TDestination Map<TSource, TDestination>(TSource source)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public TDestination Map<TSource, TDestination>(TSource source, TDestination destination)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\common.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Mapster" Version="7.4.0" />
|
||||
<PackageReference Include="Volo.Abp.ObjectMapping" Version="7.4.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Yi.Framework.Core\Yi.Framework.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Yi.Framework.Mapster</name>
|
||||
</assembly>
|
||||
<members>
|
||||
</members>
|
||||
</doc>
|
||||
@@ -0,0 +1,21 @@
|
||||
using MapsterMapper;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Volo.Abp.Modularity;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
using Yi.Framework.Core;
|
||||
|
||||
namespace Yi.Framework.Mapster
|
||||
{
|
||||
[DependsOn(typeof(YiFrameworkCoreModule),
|
||||
|
||||
typeof(AbpObjectMappingModule)
|
||||
)]
|
||||
public class YiFrameworkMapsterModule : AbpModule
|
||||
{
|
||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
||||
{
|
||||
context.Services.AddTransient<IAutoObjectMappingProvider, MapsterAutoObjectMappingProvider>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user