Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base_Engine: add methods to unpack IContainers #3000

Closed
alelom opened this issue Jan 26, 2023 · 0 comments · Fixed by #3001
Closed

Base_Engine: add methods to unpack IContainers #3000

alelom opened this issue Jan 26, 2023 · 0 comments · Fixed by #3001
Assignees
Labels
type:feature New capability or enhancement

Comments

@alelom
Copy link
Member

alelom commented Jan 26, 2023

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:

    // Must be unpackable
    public class Container<T> : IContainer
    {
        public T? SomeObject { get; set; }
        public IEnumerable<T> ListOfObjects { get; set; } = new List<T>();
        public IEnumerable<IEnumerable<T>> ListOfLists { get; set; } = new List<List<T>>();
    }

    // We want to support this, it should get the values of the dictionary.
    public class DictionaryContainer<T> : Container<T>
    {
        public Dictionary<string, T> Dictionary { get; set; } = new Dictionary<string, T>();
    }

    // We want to support this, it should get the values of the dictionary and flatten them.
    public class DictionaryListContainer<T> : Container<T>
    {
        public Dictionary<string, IEnumerable<T>> DictionaryOfLists { get; set; } = new Dictionary<string, IEnumerable<T>>();
    }

    // Not supported.
    public class ListOfDictionariesContainer<T> : Container<T>
    {
        public IEnumerable<Dictionary<string, T>> ListOfDictionaries { get; set; } = new List<Dictionary<string, T>>();
    }

    // Not supported.
    public class ListOfListOfListContainer<T> : Container<T>
    {
        public IEnumerable<IEnumerable<IEnumerable<T>>> ListOfListOfLists { get; set; } = new List<List<List<T>>>();
    }
@alelom alelom added the type:feature New capability or enhancement label Jan 26, 2023
@alelom alelom self-assigned this Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant