Pass multiple parameters in a POST API without using a DTO class in .Net Core MVC

后端 未结 5 1105
旧巷少年郎
旧巷少年郎 2021-02-15 16:53

I have an action on my web project which calls to an API

    [HttpPost]
    public async Task ExpireSurvey(int id)
    {
        var token =         


        
5条回答
  •  生来不讨喜
    2021-02-15 17:09

    you can do it with a dictionary

    Dictionary dict = new Dictionary();
    dict["id"] = 1
    dict["date"] = DateTime.Now;
    
    JsonConvert.SerializeObject(dict);
    

提交回复
热议问题