phase 05.
a .cshtml page shows data from the controller model.
- at top of view:
@model YourNamespace.SomeType - use
@Model.Property(capital M on model object) per razor rules. - loop:
@foreach (var x in Model.Lines) { ... }
page renders without runtime error when model non-null.
- null model — add
if (Model == null)or ensure controller always passes model - confusing
ViewBagvs strongly typedModel— pick one style per page
when readme says ViewBag.OrderId, where is it set?