diff --git a/src/Persistence.Tests/Yaml/DeserializerValidTests.cs b/src/Persistence.Tests/Yaml/DeserializerValidTests.cs index 0a5e34e0..a3e3e679 100644 --- a/src/Persistence.Tests/Yaml/DeserializerValidTests.cs +++ b/src/Persistence.Tests/Yaml/DeserializerValidTests.cs @@ -451,8 +451,9 @@ public void Deserialize_Should_AddGalleryTemplate(string path, bool isControlIde gallery.Children.Should().HaveCount(2); gallery.Properties.Should().NotBeNull().And.HaveCount(2); gallery.Properties.Should().NotContainKeys("TemplateFill", "OnSelect"); - var galleryTemplate = gallery.Children.FirstOrDefault(c => c.Template.Name == "GalleryTemplate"); + var galleryTemplate = gallery.Children.ElementAt(0); galleryTemplate.ShouldNotBeNull(); + galleryTemplate.Template.Name.Should().Be("GalleryTemplate"); galleryTemplate.Properties.Should().NotBeNull().And.HaveCount(1); galleryTemplate.Properties.Should().ContainKeys("TemplateFill"); } diff --git a/src/Persistence/Yaml/ControlFormatter.cs b/src/Persistence/Yaml/ControlFormatter.cs index 8e45fe4b..2cb76a10 100644 --- a/src/Persistence/Yaml/ControlFormatter.cs +++ b/src/Persistence/Yaml/ControlFormatter.cs @@ -59,9 +59,8 @@ public static T AfterDeserialize(this T control, IControlFactory controlFacto var isGroupContainer = control.Template.Name == BuiltInTemplates.GroupContainer.Name; var originalChildCount = control.Children.Count; - var children = control.Children - .Select(addZIndex) - .Concat(childrenToAdd) + var children = childrenToAdd + .Concat(control.Children.Select(addZIndex)) .ToList(); var properties = propertiesToRemove.Count > 0