you asked for layman comments and this shape:
- c# line comments:
//comment - lowercase after
// - no space after
//unless you must for readability on long lines - do not restate what the code says (
//increment i). say why or what was confusing.
//map null payment to "still open" in the ui
if (order.PaymentTypeID == null)
{
//...
}//ef needs this navigation or details page will null-ref
.Include(o => o.OrderItems)razor files are mostly html. server-side comments use razor syntax:
@*hide closed orders on home*@avoid // inside pure html (browsers may not treat it as comment). inside @{ } blocks, // is c# again.
- obvious one-liners
- the comment repeats the identifier name
- business rule from readme (“open means paymenttypeid null”)
- non-obvious ef include / why dto exists
- workaround for a bug you will forget tomorrow