[英]When i have this command, i can't use any command
I made this command and i want to be a Universal one, but if i have this command, i get "Unknown command." 我做了这个命令,我想成为一个通用命令,但是如果我有这个命令,我会得到“未知命令”。 for all commands, how i can solve that?
对于所有命令,我该如何解决?
My module is public. 我的模块是公开的。
Can i change "List< string>" to "string" and in code to convert in "List< string>"? 我可以将“ List <string>”更改为“ string”,并在代码中将其转换为“ List <string>”吗? And if yes, how i can do that?
如果是的话,我该怎么做?
[Command("addOnList")]
[Summary("Add a string to a list")]
public async Task manageList(List<string> list = null, [Remainder]string name = null)
{
//Code here
}
If I understand you correctly you can passing the list as "a,b,c".. 如果我对您的理解正确,则可以将列表传递为“ a,b,c”。
[Command("addOnList")]
[Summary("Add a string to a list")]
public async Task manageList(string csvList = null, [Remainder]string name = null)
{
var list = csvList.Split(',').ToList();
//Code here
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.