Skip to content

Commit 2285591

Browse files
committed
Merge branch 'develop'
2 parents c6383fb + d57a2e7 commit 2285591

File tree

85 files changed

+3312
-740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3312
-740
lines changed

src/AutoMapper.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
<Message Importance="low" Text="AutoMapper Platform Extension Assembly: %(_AutoMapperReference.FullPath)"/>
1414

1515
<ItemGroup>
16-
<Content Include="$([MSBuild]::MakeRelative($(MSBuildProjectDirectory), %(_AutoMapperReference.FullPath)))" Condition="'%(_AutoMapperReference.FullPath)' != ''">
16+
<None Include="$([MSBuild]::MakeRelative($(MSBuildProjectDirectory), %(_AutoMapperReference.FullPath)))" Condition="'%(_AutoMapperReference.FullPath)' != ''">
1717
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
18-
</Content>
18+
</None>
1919
</ItemGroup>
2020
</Target>
2121
</Project>

src/AutoMapper/AutoMapper.csproj

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
<Compile Include="Internal\AliasedMember.cs" />
8282
<Compile Include="Internal\IAdapterResolver.cs" />
8383
<Compile Include="Internal\ManualNullableConverterFactory.cs" />
84+
<Compile Include="Internal\MemberNameReplacer.cs" />
8485
<Compile Include="Internal\NoOpReaderWriterLockFactory.cs" />
8586
<Compile Include="Internal\NotSupportedEnumNameValueMappingFactory.cs" />
8687
<Compile Include="Internal\NotSupportedProxyGeneratorFactory.cs" />
@@ -90,6 +91,7 @@
9091
<Compile Include="Mapper.cs" />
9192
<Compile Include="Mappers\AssignableArrayMapper.cs" />
9293
<Compile Include="Mappers\ExplicitConversionOperatorMapper.cs" />
94+
<Compile Include="Mappers\ExpressionMapper.cs" />
9395
<Compile Include="Mappers\ImplicitConversionOperatorMapper.cs" />
9496
<Compile Include="Mappers\IPlatformSpecificMapperRegistry.cs" />
9597
<Compile Include="Mappers\MapperRegistry.cs" />
@@ -153,11 +155,28 @@
153155
<Compile Include="Internal\DelegateBasedResolver.cs" />
154156
<Compile Include="Internal\NullReplacementMethod.cs" />
155157
<Compile Include="Internal\PrimitiveExtensions.cs" />
158+
<Compile Include="Configuration\CreateTypeMapExpression.cs" />
156159
<Compile Include="Profile.cs" />
157160
<Compile Include="PropertyMap.cs" />
158161
<Compile Include="Internal\ReflectionHelper.cs" />
159162
<Compile Include="Internal\ProxyBase.cs" />
160-
<Compile Include="QueryableExtensions.cs" />
163+
<Compile Include="QueryableExtensions\ExpressionRequest.cs" />
164+
<Compile Include="QueryableExtensions\ExpressionResolutionResult.cs" />
165+
<Compile Include="QueryableExtensions\Extensions.cs" />
166+
<Compile Include="QueryableExtensions\IExpressionBinder.cs" />
167+
<Compile Include="QueryableExtensions\IExpressionResultConverter.cs" />
168+
<Compile Include="QueryableExtensions\Impl\AssignableExpressionBinder.cs" />
169+
<Compile Include="QueryableExtensions\Impl\CustomProjectionExpressionBinder.cs" />
170+
<Compile Include="QueryableExtensions\Impl\EnumerableExpressionBinder.cs" />
171+
<Compile Include="QueryableExtensions\Impl\MappedTypeExpressionBinder.cs" />
172+
<Compile Include="QueryableExtensions\Impl\MemberGetterExpressionResultConverter.cs" />
173+
<Compile Include="QueryableExtensions\Impl\MemberResolverExpressionResultConverter.cs" />
174+
<Compile Include="QueryableExtensions\Impl\NullableExpressionBinder.cs" />
175+
<Compile Include="QueryableExtensions\Impl\NullSubstitutionExpressionResultConverter.cs" />
176+
<Compile Include="QueryableExtensions\Impl\ParameterReplacementVisitor.cs" />
177+
<Compile Include="QueryableExtensions\Impl\StringExpressionBinder.cs" />
178+
<Compile Include="QueryableExtensions\IProjectionExpression.cs" />
179+
<Compile Include="QueryableExtensions\ProjectionExpression.cs" />
161180
<Compile Include="ResolutionContext.cs" />
162181
<Compile Include="Internal\ResolutionExpression.cs" />
163182
<Compile Include="ResolutionResult.cs" />
@@ -175,6 +194,7 @@
175194
</None>
176195
<None Include="SemanticModel.cd" />
177196
</ItemGroup>
197+
<ItemGroup />
178198
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
179199
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
180200
Other similar extension points exist, see Microsoft.Common.targets.

src/AutoMapper/AutoMapperConfigurationException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public override string Message
7878
message.AppendLine(error.TypeMap.SourceType.FullName + " -> " +
7979
error.TypeMap.DestinationType.FullName + " (" +
8080
error.TypeMap.ConfiguredMemberList + " member list)");
81-
message.AppendLine(new string('-', len));
81+
message.AppendLine();
82+
message.AppendLine("Unmapped properties:");
8283
foreach (var name in error.UnmappedPropertyNames)
8384
{
8485
message.AppendLine(name);
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
namespace AutoMapper.Configuration
2+
{
3+
using System;
4+
using System.Collections.Generic;
5+
using Impl;
6+
7+
public class CreateTypeMapExpression : IMappingExpression
8+
{
9+
private readonly List<Action<IMappingExpression>> _actions = new List<Action<IMappingExpression>>();
10+
11+
public TypePair TypePair { get; private set; }
12+
public MemberList MemberList { get; private set; }
13+
public string ProfileName { get; private set; }
14+
15+
16+
public CreateTypeMapExpression(TypePair typePair, MemberList memberList, string profileName)
17+
{
18+
TypePair = typePair;
19+
MemberList = memberList;
20+
ProfileName = profileName;
21+
}
22+
23+
public void ConvertUsing<TTypeConverter>()
24+
{
25+
_actions.Add(me => me.ConvertUsing<TTypeConverter>());
26+
}
27+
28+
public void ConvertUsing(Type typeConverterType)
29+
{
30+
_actions.Add(me => me.ConvertUsing(typeConverterType));
31+
}
32+
33+
public void As(Type typeOverride)
34+
{
35+
_actions.Add((me => me.As(typeOverride)));
36+
}
37+
38+
public IMappingExpression WithProfile(string profileName)
39+
{
40+
_actions.Add(me => me.WithProfile(profileName));
41+
42+
return this;
43+
}
44+
45+
public IMappingExpression ForMember(string name, Action<IMemberConfigurationExpression> memberOptions)
46+
{
47+
_actions.Add(me => me.ForMember(name, memberOptions));
48+
49+
return this;
50+
}
51+
52+
public IMappingExpression ForSourceMember(string sourceMemberName, Action<ISourceMemberConfigurationExpression> memberOptions)
53+
{
54+
_actions.Add(me => me.ForSourceMember(sourceMemberName, memberOptions));
55+
56+
return this;
57+
}
58+
59+
public void Accept(IMappingExpression mappingExpression)
60+
{
61+
foreach (var action in _actions)
62+
{
63+
action(mappingExpression);
64+
}
65+
}
66+
}
67+
}

0 commit comments

Comments
 (0)