Add IEnumerable<T> support for arguments
See original GitHub issueWould be nice if we supported passing multiple arguments to the Cake.exe.
cake.exe --foo=1 --foo=2 --foo=3
And allowed the user to resolve them all by resolving an IEnumerable<T> like this:
var foo = Argument<IEnumerable<int>>("foo", Enumerable.Empty<int>());
Of course there would have to be safe guards in place to ensure that we throw if the user try to resolve a single argument where multiple has been passed and vice versa.
(Originally reported at http://stackoverflow.com/questions/35727010/how-do-i-pass-an-argument-that-is-a-string-array-to-my-cake-script)
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Is there a way to treat an IEnumerable<T> as a params T ...
If you have an IEnumerable<T> and a method expects a T[] , just call ToArray on your enumerable. var fields = resultRecord.GetType().
Read more >c# - Pass IEnumerable<T> as an argument of method and ...
I've seen tutorials of Unit Testing and I've never seen that IEnumerable<T> used as an argument of method. All authors use Repository pattern ......
Read more >IEnumerable<T> Interface (System.Collections.Generic)
Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
Read more >How to add strings to a ienumerable<System.String> - Help
Hi, I am trying to add arguments (strings) to a Systems.Collections.Generic. ... IEnumerable is only to view the contents of a collection.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also thought that commandline was a good option if Cake was to improve it’s command-line support. It’s a bit confusing and inconsistent having different parameter passing done by PowerShell / Bash (in the bootstrapper) and then by Cake. It would be better if Cake did everything and the bootstrapper did nothing but bootstrap.
Any update on this one?