Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
anisimovyuriy committed Feb 1, 2016
1 parent b00c5d2 commit 51d56e4
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ExpressMapper NET40/CompilationTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace ExpressMapper
[Flags]
public enum CompilationTypes
{
OnlySource = 2,
OnlyDestination = 4
Source = 2,
Destination = 4
}
}
2 changes: 1 addition & 1 deletion ExpressMapper NET40/DestinationTypeMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class DestinationTypeMapper<T, TN> : TypeMapperBase<T, TN>, ITypeMapper<T
public DestinationTypeMapper(IMappingService service, IMappingServiceProvider serviceProvider) : base(service, serviceProvider){}

public override CompilationTypes MapperType {
get { return CompilationTypes.OnlyDestination;}
get { return CompilationTypes.Destination;}
}

protected override void InitializeRecursiveMappings(IMappingServiceProvider serviceProvider)
Expand Down
2 changes: 1 addition & 1 deletion ExpressMapper NET40/IMemberConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface IMemberConfiguration<T, TN>
IMemberConfiguration<T, TN> Function<TMember, TNMember>(Expression<Func<TN, TNMember>> dest, Func<T, TMember> src);
IMemberConfiguration<T, TN> Ignore<TMember>(Expression<Func<TN, TMember>> dest);
IMemberConfiguration<T, TN> Value<TNMember>(Expression<Func<TN, TNMember>> dest, TNMember value);
IMemberConfiguration<T, TN> CaseSensetiveMemberMap(bool caseSensitive);
IMemberConfiguration<T, TN> CaseSensitive(bool caseSensitive);
IMemberConfiguration<T, TN> CompileTo(CompilationTypes compilationType);
}
}
10 changes: 5 additions & 5 deletions ExpressMapper NET40/MappingServiceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public IQueryable<TN> Project<T, TN>(IQueryable<T> source)
var mapper = typeMapper as ITypeMapper<T, TN>;
if (mapper.QueryableExpression == null)
{
mapper.Compile(CompilationTypes.OnlySource);
mapper.Compile(CompilationTypes.Source);
}
return source.Select(mapper.QueryableExpression);
}
Expand Down Expand Up @@ -106,7 +106,7 @@ public void Compile()
{
foreach (var mappingService in _mappingServices)
{
mappingService.Compile(CompilationTypes.OnlySource | CompilationTypes.OnlyDestination);
mappingService.Compile(CompilationTypes.Source | CompilationTypes.Destination);
}
}
}
Expand Down Expand Up @@ -139,14 +139,14 @@ public void PrecompileCollection<T, TN>(CompilationTypes compilationType)
{
foreach (var mappingService in _mappingServices)
{
if ((CompilationTypes.OnlySource & compilationType) == CompilationTypes.OnlySource)
if ((CompilationTypes.Source & compilationType) == CompilationTypes.Source)
{
if (!mappingService.DestinationSupport)
{
mappingService.PrecompileCollection<T, TN>();
}
}
if ((CompilationTypes.OnlyDestination & compilationType) == CompilationTypes.OnlyDestination)
if ((CompilationTypes.Destination & compilationType) == CompilationTypes.Destination)
{
if (mappingService.DestinationSupport)
{
Expand Down Expand Up @@ -287,7 +287,7 @@ public TN Map<T, TN>(T src, TN dest)

if (EqualityComparer<TN>.Default.Equals(dest, default(TN)))
{
PrecompileCollection<T, TN>(CompilationTypes.OnlySource);
PrecompileCollection<T, TN>(CompilationTypes.Source);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion ExpressMapper NET40/MemberConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public IMemberConfiguration<T, TN> Value<TNMember>(Expression<Func<TN, TNMember>
return Member(dest, x => value);
}

public IMemberConfiguration<T, TN> CaseSensetiveMemberMap(bool caseSensitive)
public IMemberConfiguration<T, TN> CaseSensitive(bool caseSensitive)
{
foreach (var typeMapper in _typeMappers)
{
Expand Down
2 changes: 1 addition & 1 deletion ExpressMapper NET40/SourceMappingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion ExpressMapper NET40/SourceTypeMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class SourceTypeMapper<T, TN> : TypeMapperBase<T, TN>, ITypeMapper<T, TN>
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)
Expand Down
4 changes: 2 additions & 2 deletions ExpressMapper.Tests NET40/BasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ public void MemberCaseSensitivityGlobalMapTest()
public void MemberCaseSensitivityLocalMapTest()
{
Mapper.Register<TypoCase, TypoCaseViewModel>()
.CaseSensetiveMemberMap(true);
.CaseSensitive(true);
Mapper.Compile();

var typoCase = new TypoCase
Expand All @@ -1207,7 +1207,7 @@ public void MemberCaseInSensitivityGlobalOverrideMapTest()
{
Mapper.MemberCaseSensitiveMap(true);
Mapper.Register<TypoCase, TypoCaseViewModel>()
.CaseSensetiveMemberMap(false);
.CaseSensitive(false);
Mapper.Compile();

var typoCase = new TypoCase
Expand Down

0 comments on commit 51d56e4

Please sign in to comment.