更新时间:2022-10-20 22:38:24
Hey coders:
I have two controller named Team and Player ,
I want to show all player that matched by TeamID:
I added the following in my Team controller:
public ViewResult players(int id)
{
Player team = context.Players.Single(x => x.TeamID == id);
return View(team);
}
I created a view named "AllPlayers" as below:
@model FootBall.Models.Player
@{
ViewBag.Title = "AllPlayers";
}