asp.net mvc and linq to entities: how to include text value from IEnumerable<SelectListItem>
问题 I have a table with a constraint on one field - it can be 1, 2 or 3. (The correct solution to this is probably to create a lookup table for this, but for now I'm wondering if it's possible to do this without the lookup table.) I've created a class that returns an IEnumerable for the values. I'm using LINQ to Entities, and would like to be able to display the text value in a col. when listing all the entities. The code for create/edit looks like: Controller.cs: ViewData["Message_Types"] =