I'm using MVC, and one of my models is FormElementTypes
, which has an int ID
and string Name
. When I'm attempting to select the Name
property with Lambda, it doesn't return the actual string of the property.
example
foreach (FormElements e in Model.FormElements)
{
string field = Model.FormElementTypes.Where(f => f.ID == e.FormElementTypesID).Select(f => f.Name).ToString();
}
The Name
property I should be selecting should have the value of text
. But when I write it out it spits: System.Linq.Enumerable+WhereSelectListIterator`2[Scholar.Models.FormElementTypes,System.String]
What am I doing wrong, and how do I get the Name
property string?