我试图在一个视图中使用两个模型,但从我的理解我的程序只是在模型中看不到任何对象.
这是我的代码.
楷模:
public class Album
{
[Key]
public int ThreadId { get; set; }
public int GenreId { get; set; }
public string Title { get; set; }
public string ThreadByUser { get; set; }
public string ThreadCreationDate { get; set; }
public string ThreadContent { get; set; }
public Genre Genre { get; set; }
public List<Posts> Posty { get; set; }
}
public class Posts
{
[Key]
public int PostId { get; set; }
public int ThreadId …Run Code Online (Sandbox Code Playgroud)