Currently my code looks like this:
@Html.DropDownListFor( m => m.regionIdentification, new SelectList(Model.UI.region,
"Value", "Text", Model.region), new {@class = "form-control input-sm"})
I'm looking for a simple was to ignore nulls in the list when I populate the DropDown.
For example:
.notNull()
I'm trying to avoid having to use linq or update stored procedures. Any suggestion would be helpful, thanks!
m.regionIdentification.Where(r=> r != null)But you don't want to use LINQ.I'm trying to avoid having to use linqwhy?new SelectList(Model.UI.region.Where(r -> r != null)...?