From 51d56e425a908863f5437223e3376edadd981173 Mon Sep 17 00:00:00 2001 From: Yuriy Anisimov Date: Sun, 31 Jan 2016 20:01:27 -0800 Subject: [PATCH] minor refactoring --- ExpressMapper NET40/CompilationTypes.cs | 4 ++-- ExpressMapper NET40/DestinationTypeMapper.cs | 2 +- ExpressMapper NET40/IMemberConfiguration.cs | 2 +- ExpressMapper NET40/MappingServiceProvider.cs | 10 +++++----- ExpressMapper NET40/MemberConfiguration.cs | 2 +- ExpressMapper NET40/SourceMappingService.cs | 2 +- ExpressMapper NET40/SourceTypeMapper.cs | 2 +- ExpressMapper.Tests NET40/BasicTests.cs | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ExpressMapper NET40/CompilationTypes.cs b/ExpressMapper NET40/CompilationTypes.cs index 2778db9..76c518a 100644 --- a/ExpressMapper NET40/CompilationTypes.cs +++ b/ExpressMapper NET40/CompilationTypes.cs @@ -5,7 +5,7 @@ namespace ExpressMapper [Flags] public enum CompilationTypes { - OnlySource = 2, - OnlyDestination = 4 + Source = 2, + Destination = 4 } } diff --git a/ExpressMapper NET40/DestinationTypeMapper.cs b/ExpressMapper NET40/DestinationTypeMapper.cs index facf74d..2bfd09d 100644 --- a/ExpressMapper NET40/DestinationTypeMapper.cs +++ b/ExpressMapper NET40/DestinationTypeMapper.cs @@ -16,7 +16,7 @@ public class DestinationTypeMapper : TypeMapperBase, ITypeMapper IMemberConfiguration Function(Expression> dest, Func src); IMemberConfiguration Ignore(Expression> dest); IMemberConfiguration Value(Expression> dest, TNMember value); - IMemberConfiguration CaseSensetiveMemberMap(bool caseSensitive); + IMemberConfiguration CaseSensitive(bool caseSensitive); IMemberConfiguration CompileTo(CompilationTypes compilationType); } } diff --git a/ExpressMapper NET40/MappingServiceProvider.cs b/ExpressMapper NET40/MappingServiceProvider.cs index 04f72d0..35681d0 100644 --- a/ExpressMapper NET40/MappingServiceProvider.cs +++ b/ExpressMapper NET40/MappingServiceProvider.cs @@ -49,7 +49,7 @@ public IQueryable Project(IQueryable source) var mapper = typeMapper as ITypeMapper; if (mapper.QueryableExpression == null) { - mapper.Compile(CompilationTypes.OnlySource); + mapper.Compile(CompilationTypes.Source); } return source.Select(mapper.QueryableExpression); } @@ -106,7 +106,7 @@ public void Compile() { foreach (var mappingService in _mappingServices) { - mappingService.Compile(CompilationTypes.OnlySource | CompilationTypes.OnlyDestination); + mappingService.Compile(CompilationTypes.Source | CompilationTypes.Destination); } } } @@ -139,14 +139,14 @@ public void PrecompileCollection(CompilationTypes compilationType) { foreach (var mappingService in _mappingServices) { - if ((CompilationTypes.OnlySource & compilationType) == CompilationTypes.OnlySource) + if ((CompilationTypes.Source & compilationType) == CompilationTypes.Source) { if (!mappingService.DestinationSupport) { mappingService.PrecompileCollection(); } } - if ((CompilationTypes.OnlyDestination & compilationType) == CompilationTypes.OnlyDestination) + if ((CompilationTypes.Destination & compilationType) == CompilationTypes.Destination) { if (mappingService.DestinationSupport) { @@ -287,7 +287,7 @@ public TN Map(T src, TN dest) if (EqualityComparer.Default.Equals(dest, default(TN))) { - PrecompileCollection(CompilationTypes.OnlySource); + PrecompileCollection(CompilationTypes.Source); } else { diff --git a/ExpressMapper NET40/MemberConfiguration.cs b/ExpressMapper NET40/MemberConfiguration.cs index 476b852..941b811 100644 --- a/ExpressMapper NET40/MemberConfiguration.cs +++ b/ExpressMapper NET40/MemberConfiguration.cs @@ -133,7 +133,7 @@ public IMemberConfiguration Value(Expression return Member(dest, x => value); } - public IMemberConfiguration CaseSensetiveMemberMap(bool caseSensitive) + public IMemberConfiguration CaseSensitive(bool caseSensitive) { foreach (var typeMapper in _typeMappers) { diff --git a/ExpressMapper NET40/SourceMappingService.cs b/ExpressMapper NET40/SourceMappingService.cs index 0782a89..4567429 100644 --- a/ExpressMapper NET40/SourceMappingService.cs +++ b/ExpressMapper NET40/SourceMappingService.cs @@ -119,7 +119,7 @@ public Expression GetMemberQueryableExpression(Type srcType, Type dstType) var typeMapper = TypeMappers[cacheKey]; if (typeMapper.QueryableGeneralExpression == null) { - typeMapper.Compile(CompilationTypes.OnlySource); + typeMapper.Compile(CompilationTypes.Source); } return typeMapper.QueryableGeneralExpression; } diff --git a/ExpressMapper NET40/SourceTypeMapper.cs b/ExpressMapper NET40/SourceTypeMapper.cs index ea7ce62..5489997 100644 --- a/ExpressMapper NET40/SourceTypeMapper.cs +++ b/ExpressMapper NET40/SourceTypeMapper.cs @@ -15,7 +15,7 @@ public class SourceTypeMapper : TypeMapperBase, ITypeMapper public SourceTypeMapper(IMappingService service, IMappingServiceProvider serviceProvider) : base(service, serviceProvider) {} public override CompilationTypes MapperType { - get { return CompilationTypes.OnlySource;} + get { return CompilationTypes.Source;} } protected override void InitializeRecursiveMappings(IMappingServiceProvider serviceProvider) diff --git a/ExpressMapper.Tests NET40/BasicTests.cs b/ExpressMapper.Tests NET40/BasicTests.cs index 8105587..91c9b99 100644 --- a/ExpressMapper.Tests NET40/BasicTests.cs +++ b/ExpressMapper.Tests NET40/BasicTests.cs @@ -1185,7 +1185,7 @@ public void MemberCaseSensitivityGlobalMapTest() public void MemberCaseSensitivityLocalMapTest() { Mapper.Register() - .CaseSensetiveMemberMap(true); + .CaseSensitive(true); Mapper.Compile(); var typoCase = new TypoCase @@ -1207,7 +1207,7 @@ public void MemberCaseInSensitivityGlobalOverrideMapTest() { Mapper.MemberCaseSensitiveMap(true); Mapper.Register() - .CaseSensetiveMemberMap(false); + .CaseSensitive(false); Mapper.Compile(); var typoCase = new TypoCase