小编Ahm*_*sat的帖子

如何在 ASP.net Core 2 中创建动态 API

我需要知道如何通过调用另一个 API 然后传递and 来动态创建 API ,让我们假设我们有这个 API,就像这里显示的那样:[API name][API parameters]

调用接口

[HttpPost("GenerateApi")]
[ProducesResponseType(200)]
[ProducesResponseType(500)]
public IActionResult GenerateApi(RootObject ro)
{           
   //Here I need piece of code to create API dynamically
   return Ok(new { ro.apiName, ro.parameters });       
}
Run Code Online (Sandbox Code Playgroud)

以下是模型:

public class RootObject
{
   public string apiName { get; set; }
   public List<parameter> parameters { get; set; }
}

public class parameter
{
   public string parameterName { get; set; }
   public dynamic parameterType { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

现在需要做的是在控制器中创建动态 API …

c# api controller asp.net-core-2.1

7
推荐指数
1
解决办法
3051
查看次数

Swift :进行非常短的振动

我已经测试过如何产生这样的振动: How to make iPhone vibrate using Swift?

但我搜索如何一次性产生非常短的振动(例如0.5秒)

谁能帮我?谢谢 :)

ios swift

6
推荐指数
2
解决办法
2992
查看次数

标签 统计

api ×1

asp.net-core-2.1 ×1

c# ×1

controller ×1

ios ×1

swift ×1