You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need a method that outputs a flattened collection of the contents of IContainers. The flattening should support limited nested data structures, as per below:
// Must be unpackablepublicclassContainer<T>:IContainer{publicT?SomeObject{get;set;}publicIEnumerable<T>ListOfObjects{get;set;}=newList<T>();publicIEnumerable<IEnumerable<T>>ListOfLists{get;set;}=newList<List<T>>();}// We want to support this, it should get the values of the dictionary.publicclassDictionaryContainer<T>:Container<T>{publicDictionary<string,T>Dictionary{get;set;}=newDictionary<string,T>();}// We want to support this, it should get the values of the dictionary and flatten them.publicclassDictionaryListContainer<T>:Container<T>{publicDictionary<string,IEnumerable<T>>DictionaryOfLists{get;set;}=newDictionary<string,IEnumerable<T>>();}// Not supported.publicclassListOfDictionariesContainer<T>:Container<T>{publicIEnumerable<Dictionary<string,T>>ListOfDictionaries{get;set;}=newList<Dictionary<string,T>>();}// Not supported.publicclassListOfListOfListContainer<T>:Container<T>{publicIEnumerable<IEnumerable<IEnumerable<T>>>ListOfListOfLists{get;set;}=newList<List<List<T>>>();}
The text was updated successfully, but these errors were encountered:
Description:
We need a method that outputs a flattened collection of the contents of
IContainers
. The flattening should support limited nested data structures, as per below:The text was updated successfully, but these errors were encountered: