简体   繁体   English

当我有此命令时,我将无法使用任何命令

[英]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.

相关问题 为什么我不能在资源字典中使用此命令? - Why can't I use this command in my resource dictionary? 我不能在 visual studio 中使用 Rigidbody2D 命令 - I can't use Rigidbody2D command in visual studio 我可以在 C# 中运行 adb shell 命令并且在拔下 USB 电缆时不会中断它吗? - Can I run an adb shell command in C# and not have it interrupted when I unplug the USB cable? 我还可以使用sql命令的参数吗? - Can I still use parameters for sql command? 为什么我无法将Command绑定到按钮? - Why I can't bind the Command to the button? 如何在列表上使用LINQ <T> 哪里T没有任何嵌套元素? - How can I use LINQ on a List<T> where T doesn't have any nested elements? 从命令行运行简单的C#程序时,如何使用我创建的DLL? - How can I use a DLL I created when running a simple C# program from the command line? 有什么办法可以使一个命令适用于所有按钮吗? - Is there any way i can make one command apply for all buttons 有什么办法可以检测到正在调用的撤消命令? - Any way I can detect the Undo command being invoked? “sqlcmd.exe -S Instance USE ...”在命令行中工作,但我无法将其移动到 c # process - "sqlcmd.exe -S Instance USE ..." work in command line, but I can't move it to c # process
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM