I've used Visual Studio to automatically generate Controllers and Views from a database. In the database, there's a table dbo.Items, which has a FOREIGN KEY (CategoryID) REFERENCES Categories(Id)
The generated View for Items/Create has this block, which forces users to select 01 Category from a drop-down list when adding a new Item, no null value allowed:
<div class="form-group">
@Html.LabelFor(model => model.CategoryID, "CategoryID", htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.DropDownList("CategoryID", null, htmlAttributes: new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.CategoryID, "", new { @class = "text-danger" })
</div>
</div>
How do I make the Null option available?