diff --git a/appveyor.yml b/appveyor.yml
index 257f2fa2a1..64a2c50981 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -4,7 +4,7 @@ pull_requests:
branches:
only:
- master
-image: Visual Studio 2017
+image: Visual Studio 2019
nuget:
disable_publish_on_pr: true
build_script:
diff --git a/src/AutoMapper/AutoMapper.csproj b/src/AutoMapper/AutoMapper.csproj
index f16b9a7347..b587e36414 100644
--- a/src/AutoMapper/AutoMapper.csproj
+++ b/src/AutoMapper/AutoMapper.csproj
@@ -35,7 +35,7 @@
-
+
diff --git a/src/AutoMapper/Configuration/Internal/PrimitiveHelper.cs b/src/AutoMapper/Configuration/Internal/PrimitiveHelper.cs
index 021c908763..a54d87e56e 100644
--- a/src/AutoMapper/Configuration/Internal/PrimitiveHelper.cs
+++ b/src/AutoMapper/Configuration/Internal/PrimitiveHelper.cs
@@ -43,9 +43,6 @@ public static bool IsQueryableType(Type type)
public static bool IsListType(Type type)
=> typeof(IList).IsAssignableFrom(type);
- public static bool IsListOrDictionaryType(Type type)
- => type.IsListType() || type.IsDictionaryType();
-
public static bool IsDictionaryType(Type type)
=> type.ImplementsGenericInterface(typeof(IDictionary<,>));
@@ -59,7 +56,7 @@ public static bool ImplementsGenericInterface(Type type, Type interfaceType)
}
public static bool IsGenericType(Type type, Type genericType)
- => type.IsGenericType() && type.GetGenericTypeDefinition() == genericType;
+ => type.IsGenericType && type.GetGenericTypeDefinition() == genericType;
public static Type GetIEnumerableType(Type type)
=> type.GetGenericInterface(typeof(IEnumerable<>));
diff --git a/src/AutoMapper/Configuration/MappingExpressionBase.cs b/src/AutoMapper/Configuration/MappingExpressionBase.cs
index 77ccc066d3..ec0dfb9bd1 100644
--- a/src/AutoMapper/Configuration/MappingExpressionBase.cs
+++ b/src/AutoMapper/Configuration/MappingExpressionBase.cs
@@ -21,7 +21,7 @@ protected MappingExpressionBase(MemberList memberList, Type sourceType, Type des
protected MappingExpressionBase(MemberList memberList, TypePair types)
{
Types = types;
- IsOpenGeneric = types.SourceType.IsGenericTypeDefinition() || types.DestinationType.IsGenericTypeDefinition();
+ IsOpenGeneric = types.SourceType.IsGenericTypeDefinition || types.DestinationType.IsGenericTypeDefinition;
TypeMapActions.Add(tm => tm.ConfiguredMemberList = memberList);
}
public TypePair Types { get; }
@@ -59,7 +59,7 @@ public void Configure(TypeMap typeMap)
}
var destTypeInfo = typeMap.DestinationTypeDetails;
- if(!typeMap.DestinationType.IsAbstract())
+ if(!typeMap.DestinationType.IsAbstract)
{
foreach(var destCtor in destTypeInfo.Constructors.OrderByDescending(ci => ci.GetParameters().Length))
{
@@ -176,7 +176,7 @@ protected void IncludeCore(Type otherSourceType, Type otherDestinationType)
protected void CheckIsDerived(Type derivedType, Type baseType)
{
- if(!baseType.IsAssignableFrom(derivedType) && !derivedType.IsGenericTypeDefinition() && !baseType.IsGenericTypeDefinition())
+ if(!baseType.IsAssignableFrom(derivedType) && !derivedType.IsGenericTypeDefinition && !baseType.IsGenericTypeDefinition)
{
throw new ArgumentOutOfRangeException(nameof(derivedType), $"{derivedType} is not derived from {baseType}.");
}
diff --git a/src/AutoMapper/Configuration/MemberConfigurationExpression.cs b/src/AutoMapper/Configuration/MemberConfigurationExpression.cs
index 3c19113b62..d1b5381bee 100644
--- a/src/AutoMapper/Configuration/MemberConfigurationExpression.cs
+++ b/src/AutoMapper/Configuration/MemberConfigurationExpression.cs
@@ -319,7 +319,7 @@ public void Configure(TypeMap typeMap)
{
var destMember = DestinationMember;
- if(destMember.DeclaringType.IsGenericTypeDefinition())
+ if(destMember.DeclaringType.IsGenericTypeDefinition)
{
destMember = typeMap.DestinationTypeDetails.PublicReadAccessors.Single(m => m.Name == destMember.Name);
}
@@ -335,7 +335,6 @@ private void Apply(PropertyMap propertyMap)
{
action(propertyMap);
}
- propertyMap.CheckMappedReadonly();
}
public LambdaExpression SourceExpression => _sourceExpression;
diff --git a/src/AutoMapper/Configuration/PrimitiveExtensions.cs b/src/AutoMapper/Configuration/PrimitiveExtensions.cs
index 1cabbf8585..f345f1ba00 100644
--- a/src/AutoMapper/Configuration/PrimitiveExtensions.cs
+++ b/src/AutoMapper/Configuration/PrimitiveExtensions.cs
@@ -47,9 +47,6 @@ public static bool IsQueryableType(this Type type)
public static bool IsListType(this Type type)
=> PrimitiveHelper.IsListType(type);
- public static bool IsListOrDictionaryType(this Type type)
- => PrimitiveHelper.IsListOrDictionaryType(type);
-
public static bool IsDictionaryType(this Type type)
=> PrimitiveHelper.IsDictionaryType(type);
diff --git a/src/AutoMapper/DefaultMemberMap.cs b/src/AutoMapper/DefaultMemberMap.cs
index fb0d1fbff1..9ebdaf9308 100644
--- a/src/AutoMapper/DefaultMemberMap.cs
+++ b/src/AutoMapper/DefaultMemberMap.cs
@@ -26,6 +26,7 @@ public class DefaultMemberMap : IMemberMap
public virtual bool IsMapped => Ignored || CanResolveValue;
public virtual bool Ignored { get => default; set { } }
public virtual bool Inline { get => true; set { } }
+ public virtual bool CanBeSet => true;
public virtual bool? UseDestinationValue { get => default; set { } }
public virtual object NullSubstitute { get => default; set { } }
public virtual LambdaExpression PreCondition { get => default; set { } }
diff --git a/src/AutoMapper/Execution/DelegateFactory.cs b/src/AutoMapper/Execution/DelegateFactory.cs
index 72c7681842..4bae9d6b1c 100644
--- a/src/AutoMapper/Execution/DelegateFactory.cs
+++ b/src/AutoMapper/Execution/DelegateFactory.cs
@@ -25,7 +25,7 @@ private static Func