I'm working on a MVC 5 project, very new to MVC. I noticed this line in the code:
@Html.DropDownListFor(model => model.ContractorId, Model.Contractors)
the directive on the top of the page is:
@model Project.Models.ContractViewModel
The ContractViewModel class does have a Contractors object in it.
public IEnumerable<SelectListItem> Contractors
I'm just a little confused on the capital M (Model.Contractors), does Model always refer to the object passed in the @model? Then what is the difference between using Model.Contractors and model.Contractors?
@Html.DropDownListFor(m => m.ContractorId, Model.Contractors)even@Html.DropDownListFor(myself => myself.ContractorId, Model.Contractors)are also correct.