ASP.NET - 找到与请求匹配的多个操作

时间:2016-01-14 16:21:05

标签: c# asp.net

我有这两种方法:

public List<ProntoCheckListSaveClass> updateProntoCheckList(List<ProntoCheckListSaveClass> items)
{
    tblJobsConnectionClass jobs = new tblJobsConnectionClass();
    return jobs.updateProntoCheckList(items);
}

public List<UserModel> PostTasks(List<CellModel> cells)
{
    List<UserModel> model = new List<UserModel>();

    if (cells == null)
    {
        UserModel nullModel = new UserModel();
        nullModel.name = "NF";
        nullModel.userName = "NF";
        model.Add(nullModel);
        return model;
    }
    else
    {
        tblJobsConnectionClass jobs = new tblJobsConnectionClass();   
        model.Add(jobs.PostScheduledTasks(cells));
        return model;
    }
}

当我尝试调用updateProntoCheckList时,出现此错误:

  

{\“消息\”:\“错误有   发生了。\“,\”ExceptionMessage \“:\”发现了多个动作   匹配请求:   \ r \ nSystem.Collections.Generic.List 1[LosaniHomesSchedulingWebAPI.Models.ProntoCheckListSaveClass] updateProntoCheckList(System.Collections.Generic.List 1 [LosaniHomesSchedulingWebAPI.Models.ProntoCheckListSaveClass])   在类型上   LosaniHomesSchedulingWebAPI.Controllers.tblJobsController \ r \ nSystem.Collections.Generic.List 1[LosaniHomesSchedulingWebAPI.Models.UserModel] PostTasks(System.Collections.Generic.List 1 [LosaniHomesSchedulingWebAPI.Models.CellModel])   在类型上   LosaniHomesSchedulingWebAPI.Controllers.tblJobsController \ “\ ”ExceptionType \“:\ ”System.InvalidOperationException \“,\ ”堆栈跟踪\“:\”   在   System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem.SelectAction(HttpControllerContext   controllerContext)\ r \ n at   System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext   controllerContext,CancellationToken cancellationToken)\ r \ n at   System.Web.Http.Dispatcher.HttpControllerDispatc ...“0x795c9000

尝试在objective-c

中调用此方法

0 个答案:

没有答案