Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. Dictionary<string, List<MyType>> myDico = GetDictionary();
  2. List<MyType> items = ???
  3.  
  4. List<MyType> items = new List<MyType>(myDico.values)
  5.  
  6. var items = myDico.SelectMany (d => d.Value).ToList();
  7.  
  8. List<MyType> allItems = myDico.Values.SelectMany(c => c).ToList();
  9.  
  10. List<MyType> items = new List<MyType>();
  11. items.AddRange(myDico.values);
  12.  
  13. var values = myDico.Values.ToList();
  14.  
  15. var MyList = new List<MyType>(MyDico.Values);
  16.  
  17. List<MyType> allItems = myDico.Values.Where(x => x != null).SelectMany(x => x).ToList();
  18.  
  19. List<MyType> items = new List<MyType>()
  20. foreach(var value in myDico.Values)
  21. items.AddRange(value);
  22.  
  23. Dictionary<string, MyType> myDico = GetDictionary();
  24. List<MyType> items = new List<MyType>(myDico.Values);
  25.  
  26. List<String> objListColor = new List<String>() { "Red", "Blue", "Green", "Yellow" };
  27. List<String> objListDirection = new List<String>() { "East", "West", "North", "South" };
  28.  
  29. Dictionary<String, List<String>> objDicRes = new Dictionary<String, List<String>>();
  30. objDicRes.Add("Color", objListColor);
  31. objDicRes.Add("Direction", objListDirection);
  32.  
  33. MyType[] Temp = new MyType[myDico.Count];
  34. myDico.Values.CopyTo(Temp, 0);
  35. List<MyType> items = Temp.ToList();
  36.  
  37. Dictionary<string, MyType> myDico = GetDictionary();
  38.  
  39. var items = myDico.Select(d=> d.Value).ToList();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement