Add multiple instances of a property to a list I'm a novice programmer asking first question here although I've gotten tons of help from previous questions.
The following code is abstracted from what I currently have working.  

List&lt;decimal&gt; teamAverage1 = new List&lt;decimal&gt;();
List&lt;decimal&gt; teamAverage2 = new List&lt;decimal&gt;();
List&lt;decimal&gt; teamAverage3 = new List&lt;decimal&gt;();

foreach (int id in TeamIds)
{
    foreach (Player player in Players.Where(p =&gt; p.teamId == id &amp;&amp; p.a == 'x'))
    {
        teamAverage1.Add(player.Average1);
    }
    foreach (Player player in Players.Where(p =&gt; p.teamId == id &amp;&amp; p.b == 'y'))
    {
        teamAverage2.Add(player.Average2);
    }
    foreach (Player player in Players.Where(p =&gt; p.teamId == id &amp;&amp; p.c == 'z'))
    {
        teamAverage3.Add(player.Average3);
    }
}


Is there a way to get rid of the nested foreach loop and do something like:

foreach (int id in TeamIds)
{
    List&lt;decimal&gt; teamAverage1 = Players.Where(p =&gt; p.teamId == id &amp;&amp; p.a == 'x').Average1
    List&lt;decimal&gt; teamAverage2 = Players.Where(p =&gt; p.teamId == id &amp;&amp; p.b == 'y').Average2
    List&lt;decimal&gt; teamAverage3 = Players.Where(p =&gt; p.teamId == id &amp;&amp; p.c == 'z').Average3
}


Is there a way to do this and if there is - is it a better solution than the original code?  I have a long list of properties to average and this would be much cleaner than many foreach loops. 

More info: TeamIds identify each team.  Each player has teamId to relate it to a team.  Code should iterate every team id, find different subsets of players that belong to that team and add the stats of those players to lists for the team.  Thank you for your help, let me know if still not clear or if I have something wrong.

The linq statements can and will return more than one record.
You can shorten the first part to 3x this:

var teamAverage1 = Players
    .Where(p =&gt; p.teamId == id &amp;&amp; p.a == 'x')
    .Select(x =&gt; x.Average1)
    .ToList();


I don't like the p.a properties. They look like a bad design. But it's hard to say more from the snippet you've showed.