private LayoutEntity CreateLayout(string themeName) { LayoutEntity layoutEntity = _layoutService.Get(m => m.Title == themeName).FirstOrDefault(); if (layoutEntity == null) { layoutEntity = new LayoutEntity { Title = themeName, LayoutName = themeName }; layoutEntity.Zones = new ZoneCollection(); layoutEntity.Html = new LayoutHtmlCollection(); string[] zoneNames = new string[] { "Header", "Content", "Footer" }; for (int i = 0; i < zoneNames.Length; i++) { ZoneEntity zone = new ZoneEntity { ZoneName = zoneNames[i], HeadingCode = $"ZONE-{i}" }; layoutEntity.Zones.Add(zone); layoutEntity.Html.Add(new LayoutHtml { Html = "<div class=\"main custom-style container-fluid\"><div class=\"additional row\"><div class=\"additional col-md-12\"><div class=\"colContent row\"><div class=\"additional zone\">" }); layoutEntity.Html.Add(new LayoutHtml { Html = ZoneEntity.ZoneTag }); layoutEntity.Html.Add(new LayoutHtml { Html = zone.HeadingCode }); layoutEntity.Html.Add(new LayoutHtml { Html = ZoneEntity.ZoneEndTag }); layoutEntity.Html.Add(new LayoutHtml { Html = "</div></div></div></div></div>" }); } _layoutService.Add(layoutEntity); } return(layoutEntity); }