Skip to content

Commit dd72c18

Browse files
JasonElkinbergmania
authored andcommitted
add MaybeNull attribute to mixin properties (#11171)
1 parent 913e812 commit dd72c18

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Umbraco.Infrastructure/ModelsBuilder/Building/TextBuilder.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ private void WriteMixinProperty(StringBuilder sb, PropertyModel property, string
255255
}
256256

257257
WriteGeneratedCodeAttribute(sb, "\t\t");
258+
259+
if (!property.ModelClrType.IsValueType)
260+
{
261+
WriteMaybeNullAttribute(sb, "\t\t", false);
262+
}
258263
sb.AppendFormat("\t\t[ImplementPropertyType(\"{0}\")]\n", property.Alias);
259264

260265
sb.Append("\t\tpublic virtual ");

0 commit comments

Comments
 (0)