Skip to content

Commit

Permalink
bump version to 6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chaowlert committed Jul 30, 2020
1 parent 6d14c9d commit 2ca30a1
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 29 deletions.
8 changes: 4 additions & 4 deletions src/Benchmark/Benchmarks/TestAll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ public class TestAll
[Params(100_000)]//, 1_000_000)]
public int Iterations { get; set; }

[Benchmark(Description = "Mapster 5.0.0")]
[Benchmark(Description = "Mapster 6.0.0")]
public void MapsterTest()
{
TestAdaptHelper.TestMapsterAdapter<Foo, Foo>(_fooInstance, Iterations);
TestAdaptHelper.TestMapsterAdapter<Customer, CustomerDTO>(_customerInstance, Iterations);
}

[Benchmark(Description = "Mapster 5.0.0 (Roslyn)")]
[Benchmark(Description = "Mapster 6.0.0 (Roslyn)")]
public void RoslynTest()
{
TestAdaptHelper.TestMapsterAdapter<Foo, Foo>(_fooInstance, Iterations);
TestAdaptHelper.TestMapsterAdapter<Customer, CustomerDTO>(_customerInstance, Iterations);
}

[Benchmark(Description = "Mapster 5.0.0 (FEC)")]
[Benchmark(Description = "Mapster 6.0.0 (FEC)")]
public void FecTest()
{
TestAdaptHelper.TestMapsterAdapter<Foo, Foo>(_fooInstance, Iterations);
TestAdaptHelper.TestMapsterAdapter<Customer, CustomerDTO>(_customerInstance, Iterations);
}

[Benchmark(Description = "Mapster 5.0.0 (Codegen)")]
[Benchmark(Description = "Mapster 6.0.0 (Codegen)")]
public void CodegenTest()
{
TestAdaptHelper.TestCodeGen(_fooInstance, Iterations);
Expand Down
4 changes: 2 additions & 2 deletions src/Benchmark/Benchmarks/TestComplexTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public void MapsterTest()
TestAdaptHelper.TestMapsterAdapter<Customer, CustomerDTO>(_customerInstance, Iterations);
}

[Benchmark(Description = "Mapster 5.0.0 (Roslyn)")]
[Benchmark(Description = "Mapster 6.0.0 (Roslyn)")]
public void RoslynTest()
{
TestAdaptHelper.TestMapsterAdapter<Customer, CustomerDTO>(_customerInstance, Iterations);
}

[Benchmark(Description = "Mapster 5.0.0 (FEC)")]
[Benchmark(Description = "Mapster 6.0.0 (FEC)")]
public void FecTest()
{
TestAdaptHelper.TestMapsterAdapter<Customer, CustomerDTO>(_customerInstance, Iterations);
Expand Down
4 changes: 2 additions & 2 deletions src/Benchmark/Benchmarks/TestSimpleTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public void MapsterTest()
TestAdaptHelper.TestMapsterAdapter<Foo, Foo>(_fooInstance, Iterations);
}

[Benchmark(Description = "Mapster 5.0.0 (Roslyn)")]
[Benchmark(Description = "Mapster 6.0.0 (Roslyn)")]
public void RoslynTest()
{
TestAdaptHelper.TestMapsterAdapter<Foo, Foo>(_fooInstance, Iterations);
}

[Benchmark(Description = "Mapster 5.0.0 (FEC)")]
[Benchmark(Description = "Mapster 6.0.0 (FEC)")]
public void FecTest()
{
TestAdaptHelper.TestMapsterAdapter<Foo, Foo>(_fooInstance, Iterations);
Expand Down
4 changes: 3 additions & 1 deletion src/Mapster.EFCore.Tests/EFCoreTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public void TestFindObject()
.EntityFromContext(context)
.AdaptTo(poco);

poco.Enrollments.First().Grade.ShouldBe(Grade.F);
var first = poco.Enrollments.First();
first.CourseID.ShouldBe(3141);
first.Grade.ShouldBe(Grade.F);
}
}
public class StudentDto
Expand Down
8 changes: 7 additions & 1 deletion src/Mapster.Immutable/ImmutableAdapter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
Expand Down Expand Up @@ -36,7 +37,12 @@ protected override bool CanMap(PreCompileArgument arg)
var args = arg.DestinationType.GetGenericArguments();
if (args.Length == 2 && args[0] == typeof(string))
return true;
return arg.SourceType.IsCollection();
return IsCollection(arg.SourceType);
}

private static bool IsCollection(Type type)
{
return typeof(IEnumerable).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo()) && type != typeof(string);
}

protected override Expression CreateInstantiationExpression(Expression source, Expression? destination, CompileArgument arg)
Expand Down
6 changes: 3 additions & 3 deletions src/Mapster.Immutable/Mapster.Immutable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<TargetFrameworks>net45;netstandard1.3;netstandard2.0</TargetFrameworks>
<Authors>Chaowlert Chaisrichalermpol</Authors>
<Company>Chaowlert Chaisrichalermpol</Company>
<Description>Json.net conversion supports for Mapster</Description>
<Description>Immutable collection supports for Mapster</Description>
<PackageProjectUrl>https://github.com/MapsterMapper/Mapster</PackageProjectUrl>
<RepositoryUrl>https://github.com/MapsterMapper/Mapster</RepositoryUrl>
<PackageTags>Mapster;Json.net</PackageTags>
<PackageTags>Mapster;Immutable</PackageTags>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Mapster.Immutable.snk</AssemblyOriginatorKeyFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.1.0</Version>
<Version>1.0.0</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright>Copyright (c) 2020 Chaowlert Chaisrichalermpol</Copyright>
<PackageIcon>icon.png</PackageIcon>
Expand Down
15 changes: 0 additions & 15 deletions src/Mapster.Immutable/ReflectionUtils.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Mapster/Mapster.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.3' ">1.6.1</NetStandardImplicitPackageVersion>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<RootNamespace>Mapster</RootNamespace>
<Version>5.4.0</Version>
<Version>6.0.0</Version>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<NoWarn>1701;1702;8618</NoWarn>
Expand Down

0 comments on commit 2ca30a1

Please sign in to comment.