清除重复的查询字符串值asp.net

时间:2018-05-14 14:52:01

标签: c# asp.net http asp.net-web-api

我想使用查询字符串中的值创建和命名文件夹。例如:

api/controller?lotid=value&operation=value

调试应用程序后(如下所示)我意识到我测试的每个请求都成了一个集合。因此,我怀疑该文件夹名为(Collection)_(Collection),而不是查询字符串值lotid_operation

知道为什么会这样吗?

这是我在控制器文件中获取查询的方法

public string Get(string lotid, string operation) {
    //Secrets
}

这里我创建文件夹名称

string folderName = lotid + "_" + operation;

以及AbsoluteUri在调试器面板中的外观

http://localhost:5000/api/otdash?lotid=XBSs&operation=xhr1&lotid=S23B&operation=xhr1&lotid=SWB45&operation=xhr1&lotid=SWB556&operation=34s&lotid=SD23&operation=xhr1&lotid=322&operation=3sl&lotid=%27sdfa%27&operation=%27ada%27&lotid=%27SWBT12010%27&operation=%27xhr1%27&lotid=%27SWEB000%27&operation=%27xhr1&lotid=%27RESS0292%27&operation=%27das%27&lotid=SBBB&operation=sasc&lotid=%27ssss%27&operation=%27A34%27

0 个答案:

没有答案