Merge branch 'master' of https://git.nejcraft.cz/honzapatCZ/AutoMapProperty
This commit is contained in:
commit
099ce1dbd9
|
|
@ -649,8 +649,6 @@ namespace AutoMapProperty
|
|||
|
||||
public static string? GeneratePropertyTo(List<ClassToGenerate> otherClasses, string Key, ITypeSymbol FromType, ITypeSymbol ToType, bool nullable = true)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append(Key).Append(@" =");
|
||||
|
||||
|
||||
var concreteToType = GetConcreteType(ToType);
|
||||
|
|
@ -661,6 +659,15 @@ namespace AutoMapProperty
|
|||
if (concreteFromType.IsAbstract)
|
||||
return null;
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if (isArray)
|
||||
{
|
||||
sb.Append(Key).Append(".Any(); source.");
|
||||
}
|
||||
|
||||
sb.Append(Key).Append(@" =");
|
||||
|
||||
if (isArray)
|
||||
{
|
||||
sb.Append("(").Append(FromType).Append(@")(this.").Append(Key).Append(" != null ? ");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user