eol to not have to setup certain parametres with null
This commit is contained in:
parent
501291c548
commit
0be24c0990
|
|
@ -279,12 +279,12 @@ namespace AutoMapProperty
|
|||
IMethodSymbol? customFromMethod = null;
|
||||
bool customTo = false;
|
||||
IMethodSymbol? customToMethod = null;
|
||||
if (attr.ConstructorArguments.Count() >= 3)
|
||||
if (attr.ConstructorArguments.Count() >= 3 && attr.ConstructorArguments[2].Value is not null)
|
||||
{
|
||||
customTo = true;
|
||||
customToMethod = ProcessCustomAttribute(context, classSymbol, attr.ConstructorArguments[2]);
|
||||
}
|
||||
if (attr.ConstructorArguments.Count() >= 4)
|
||||
if (attr.ConstructorArguments.Count() >= 4 && attr.ConstructorArguments[3].Value is not null)
|
||||
{
|
||||
customFrom = true;
|
||||
customFromMethod = ProcessCustomAttribute(context, classSymbol, attr.ConstructorArguments[3]);
|
||||
|
|
@ -599,7 +599,7 @@ namespace AutoMapProperty
|
|||
return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append(Key).Append(" = (").Append(GetFullString(Value.ToType)).Append(@")").Append(GetFullMethodName(Value.CustomFromMethod)).Append(@"(providers, source, source").Append(prefix).Append(".").Append(Key).Append(")");
|
||||
sb.Append(Key).Append(" = (").Append(GetFullString(Value.ToType)).Append(@")").Append(GetFullMethodName(Value.CustomFromMethod)).Append(@"(providers, source").Append(prefix).Append(", source").Append(prefix).Append(".").Append(Key).Append(")");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user