Есть бд у нее есть 3 таблицы:
Команды:
Игроки:
И трансферы:
Как вывести 3 таблицу, чтоб вместо TeamId и PlayerId были имена и название команд?
Модели
Игроки
public partial class Players
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Players()
{
Transfers = new HashSet();
}
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int PlayerId { get; set; }
[StringLength(50)]
public string namePlayer { get; set; }
public int? numberOfMatchesPlayed { get; set; }
public int? numberOfYellowCards { get; set; }
public int? numberOfRedCards { get; set; }
public int? numberOfgoalsScored { get; set; }
public int? playerCoefficient { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection Transfers { get; set; }
}
Команды
public partial class Teams
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public Teams()
{
Transfers = new HashSet();
}
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int TeamId { get; set; }
[StringLength(30)]
public string nameClub { get; set; }
public int? numberOfgames { get; set; }
public int? Won { get; set; }
public int? equalityOfPoints { get; set; }
public int? defeat { get; set; }
public int? hammeredBalls { get; set; }
public int? missedBalls { get; set; }
public int? goalDifference { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection Transfers { get; set; }
}
Трансферы
public partial class Transfers
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public int TransfId { get; set; }
public int? TeamId { get; set; }
public int? PlayerId { get; set; }
[Column(TypeName = "money")]
public decimal? CostPlayer { get; set; }
public DateTime? DateTransfer { get; set; }
public DateTime? DateOut { get; set; }
public virtual Players Players { get; set; }
public virtual Teams Teams { get; set; }
}