I've got a model that has an ICollection of telephone numbers. In my view I want to display the value for the record that is marked as Primary.
@Html.DisplayFor(model => model.Telephones.Where(a=>a.Primary==true).Number)
The .Number is not allowed in the Linq syntax. How would one go about making the above line work or rather what is the proper way to display the number?
I probably should do the logic in the controller and put the value in a view model but it seems like this should be doable.