Answer the question
In order to leave comments, you need to log in
Data output to the appropriate parameters?
There is a class
public class Game
{
public int Id { get; set; }
public DateTime date { get; set; }
public int? StadiumId { get; set; }
public Stadium Stadium { get; set; }
public Team team1 { get; set; }
public int team1Id { get; set; }
public Team team2 { get; set; }
public int team2Id { get; set; }
}
public class Stadium
{
public int Id { get; set; }
public string Name { get; set; }
public int Seats { get; set; }
public float Price { get; set; }
public ICollection<Game> Games { get; set; }
public Stadium()
{
Games = new List<Game>();
}
}
<dt>
@Html.DisplayNameFor(model => model.Games.Count)
</dt>
<dd>
@Html.DisplayFor(model => model.Games.Count)
</dd>
Answer the question
In order to leave comments, you need to log in
In this case, the appearance value of your models and Views is somewhere around zero. Show the code where you retrieve the data and the model generation code. Yes, and so, by the way - using EF in the controller is a very bad idea that smells like bad architecture.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question