# Why does Visual Studio thing my document type property is nullable when the property is made "manditory" in the backoffice?

**URL:** <https://forum.umbraco.com/t/why-does-visual-studio-thing-my-document-type-property-is-nullable-when-the-property-is-made-manditory-in-the-backoffice/8523>\
**Category:** Questions\
**Tags:** v17\
**Created:** [September 9, 2026, 8:05am UTC](https://forum.umbraco.com/t/why-does-visual-studio-thing-my-document-type-property-is-nullable-when-the-property-is-made-manditory-in-the-backoffice/8523 "2026-09-09T08:05:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![justin-nevitech](https://forum.umbraco.com/user_avatar/forum.umbraco.com/justin-nevitech/32/6219_2.png) [@justin-nevitech](https://forum.umbraco.com/u/justin-nevitech)\
**Post date:** [September 9, 2026, 9:10am UTC](https://forum.umbraco.com/t/why-does-visual-studio-thing-my-document-type-property-is-nullable-when-the-property-is-made-manditory-in-the-backoffice/8523/2 "2026-09-09T09:10:43Z")

</div>

Hi @Eaglef90

Models Builder marks every reference-type property as nullable because it doesn’t take validation into account. Mandatory is a backoffice thing, and even there it only stops you publishing. You can still save a draft with the field empty, including via the API.

Simplest fix is to fall back to an empty string:

`Headline = x.Headline ?? String.Empty,`

Or you can tell the compiler it’s never null, but that’s a bit of a risk:

`Headline = x.Headline!,`

Justin

---

_[View the full topic](https://forum.umbraco.com/t/why-does-visual-studio-thing-my-document-type-property-is-nullable-when-the-property-is-made-manditory-in-the-backoffice/8523)._
