I am new to LINQ.
playerData is a list<DataAccess.Team> and I want to initialize another list of playerViewModelList with the data from playerData.
I tried foreach.
foreach (DataAccess.Team dataTeam in playerData)
{
playerViewModelList.Add(new PlayersViewModel
{
PicPath = dataTeam.Tied.ToString(),
PlayerID = (int)dataTeam.ID,
PlayerName = dataTeam.TeamName
});
}
Is it possible to achieve the same thing using LINQ?