Add further progress

This commit is contained in:
Nikolaj
2020-09-02 14:44:01 +02:00
parent 064acda304
commit 1eb7e9c1eb
14 changed files with 117 additions and 93 deletions

View File

@@ -191,9 +191,10 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
type.ClrName);
sb.Append("\t\t\t=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(publishedSnapshotAccessor), selector);\n");
sb.Append("#pragma warning restore 0109\n\n");
sb.Append("private IPublishedValueFallback _publishedValueFallback;");
// write the ctor
sb.AppendFormat("\t\t// ctor\n\t\tpublic {0}(IPublished{1} content)\n\t\t\t: base(content)\n\t\t{{ }}\n\n",
sb.AppendFormat("\t\t// ctor\n\t\tpublic {0}(IPublished{1} content, IPublishedValueFallback publishedValueFallback)\n\t\t\t: base(content)\n\t\t{{\n _publishedValueFallback = publishedValueFallback; \n}}\n\n",
type.ClrName, type.IsElement ? "Element" : "Content");
// write the properties
@@ -324,7 +325,7 @@ namespace Umbraco.ModelsBuilder.Embedded.Building
WriteClrType(sb, property.ClrTypeName);
sb.Append(">");
}
sb.AppendFormat("(\"{0}\");\n",
sb.AppendFormat("(_publishedValueFallback, \"{0}\");\n",
property.Alias);
}