This is how I call the model in the view:
Expand|Select|Wrap|Line Numbers
- @model IEnumerable<MyApp.Models.Problems>
Expand|Select|Wrap|Line Numbers
- public class Problems
- {
- public int Id { get; set; }
- public string Title { get; set; }
- public IEnumerable<MyApp.Models.Category> Categories { get; set; }
- public IEnumerable<MyApp.Models.Type> Types {get; set;}
- }
Expand|Select|Wrap|Line Numbers
- public partial class Category
- {
- public int Id { get; set; }
- public string Title { get; set; }
- }
- public partial class Type
- {
- public int Id { get; set; }
- public int Order { get; set; }
- public string Description { get; set; }
- }
This calls the Title in my Problems model which is being loaded:
Expand|Select|Wrap|Line Numbers
- @Html.DisplayNameFor(model => model.Title)