[英]How to generate dynamic API's in ASP.net Core 2.1
I need to know how to generate API's dynamically, let's we assume that we have their definitions in an XML file, like the below:我需要知道如何动态生成 API,让我们假设我们在 XML 文件中有它们的定义,如下所示:
<?xml version="1.0" encoding="UTF-8" ?>
<APIS>
<API>
<APIName>getCategories</APIName>
<APIinputs>
<categoryName>Politics</categoryName>
<categoryID>1150</categoryID>
</APIinputs>
</API>
<API>
<APIName>getEmployees</APIName>
<APIinputs>
<DepartmentName>HR</DepartmentName>
<DepartmentID>1150</DepartmentID>
</APIinputs>
</API>
</APIS>
Now what needs to be done, is to to read the above and generate from it the listed API's.现在需要做的是阅读上面的内容并从中生成列出的 API。 So then we would have the APIs generated and they can be called from their URLs like this www.example.com/api/v1/controller/getCategories/{categoryName}/{categoryID}
那么我们将生成 API,并且可以像这样从它们的 URL 调用它们 www.example.com/api/v1/controller/getCategories/{categoryName}/{categoryID}
Can you please provide me some insight of this.你能否让我对此有所了解。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.