public Dictionary<int, B> BList { get; private set; } = new Dictionary<int, B>();
                  
                  
                    private void Init(int col)
                  
                  
                    {
                  
                  
                      for (int i = 0; i < col; i++)
                  
                  
                      {
                  
                  
                        this.BList.Add(i, new B() { Ver = col });
                  
                  
                      }
                  
                  
                    }
                  
                  
                  }
                  
                  
                  class B { public int Ver { get; set; } }
                  
                  
                  
                  
                  
                  class C
                  
                  
                  {
                  
                  
                    void m()
                  
                  
                    {
                  
                  
                      List<A> list = new List<A>();
                  
                  
                      list.Add(new A(5));
                  
                  
                      list.Add(new A(3));
                  
                  
                      list.Add(new A(7));
                  
                  
                  
                  
                  
                      //как получить список List<A> из list, где B.Ver = 3?
                  
                  
                      var newList = list.Select(...);
                  
                  
                    }
                  
                  
                  }
                  
                  
                
list.SelectMany(x => x.BList).Where(x => x.Ver == 3)
Обсуждают сегодня