diff --git a/Source/OnyxTemplate/DocumentModel/Document.cs b/Source/OnyxTemplate/DocumentModel/Document.cs index bc7f3f5..93e7a05 100644 --- a/Source/OnyxTemplate/DocumentModel/Document.cs +++ b/Source/OnyxTemplate/DocumentModel/Document.cs @@ -123,7 +123,7 @@ static void ScanThisScope(TemplateTypeDescriptor.Builder descriptor, IReadOnlyLi if (n <= 1) return; - var complexTypeName = Identifier.MakeSafe(loop.Variable + "Item"); + var complexTypeName = Identifier.MakeSafe(loop.Collection.Name + "Item"); var complexType = new TemplateTypeDescriptor.Builder(descriptor) .WithName(complexTypeName); ScanThisScope(complexType, loop.Blocks); diff --git a/Source/OnyxTemplate/DocumentWriter.cs b/Source/OnyxTemplate/DocumentWriter.cs index f14395e..70def6f 100644 --- a/Source/OnyxTemplate/DocumentWriter.cs +++ b/Source/OnyxTemplate/DocumentWriter.cs @@ -150,7 +150,7 @@ string resolveField(DocumentFieldReference fieldRef) fieldReference = $"{fieldReference} != null"; break; case TemplateFieldType.Collection: - fieldReference = $"({fieldReference} != null && {fieldReference}.Any())"; + fieldReference = $"({fieldReference} != null && {fieldReference}.Count > 0)"; break; default: throw new ArgumentOutOfRangeException(); diff --git a/Source/OnyxTemplate/PackageVersion.txt b/Source/OnyxTemplate/PackageVersion.txt index dd26934..b83c9c2 100644 --- a/Source/OnyxTemplate/PackageVersion.txt +++ b/Source/OnyxTemplate/PackageVersion.txt @@ -1 +1 @@ -1.3.1-alpha \ No newline at end of file +1.3.2-alpha \ No newline at end of file diff --git a/Source/OnyxTemplate/ReleaseNotes.txt b/Source/OnyxTemplate/ReleaseNotes.txt index 58b0829..7833308 100644 --- a/Source/OnyxTemplate/ReleaseNotes.txt +++ b/Source/OnyxTemplate/ReleaseNotes.txt @@ -1,4 +1,8 @@ -v.1.3.1-alpha +v.1.3.2-alpha + - Forgot to replace .Any() with .Count > 0 when changing from IEnumerable to IReadOnlyList + - Collection item names used the variable name instead of the collection name, breaking backwards compatibility. + +v.1.3.1-alpha - I stupidly had implicit usings in my test project, which meant that code that shouldn't have compiled, compiled. Fixed that. v.1.3.0-alpha