在開發 ASP․NET Core Web API 的[HttpPost]動作方法用來建立資料時,我們可以使用CreatedAtAction或CreatedAtRoute來回應訊息,但是可能會遇到No route matches the supplied values的問題,這篇文章我來說說問題發生的原因與解決方案。 建立範例 Web API 專案 以下我們用 .NET 7 為範例: 建立api1專案...
您好,有可能是查询方法参数touristRouteId命名未在return CreateAtRoute中进行指定,如果CreateAtRoute返回第二个参数routeValue为 new { touristRouteToReturn.Id }则会出错,但是routeValue为new { touristRouteId = touristRouteToReturn.Id }则会正确返回预期结果 1 回复 慕后端2012069 #1 非常感谢,发现是 return...
经过修改 post controller 中的 GetPostByIdAsync(Guid id) => GetPost(Guid id) 后不再报错:
when passing null non-Route paramater to ActionLink "The LINQ expression node type 'Invoke' is not supported in LINQ to Entities" when using PredicateBuilder, help please (@Html.DropDownListFor) how to display the selected text instead of the value on MVC generated Details page (Bad binary sig...
越来越多的编程语言、框架开始拥抱云原生,例如 Spring 推出了面向云原生的技术 Spring Native、RedHat 开源...
今天在跟着《Agile Web Development with Rails》上面的例子在做的时候,在新添加一 个contrller的时候出现 “No route matches”错误。 上网查了下,解决方法如下: 修改项目目录的 configuration/routes.rb 文件 添加 map.connect '', :controller => "index" ...
# The priority is based upon order of creation: first created -> highest priority. # Sample of regular route: # map.connect 'products/:id', :controller => 'catalog', :action => 'view' # Keep in mind you can assign values other than :controller and :action ...
确保控制器和操作名称正确。 如果您使用的是常规的RESTful路由,那么控制器名称应该是复数形式,而操作名称应该是RESTful操作之一(例如,show,edit,update等)。 如果您使用了自定义路由,可能需要检查您的控制器和操作是否与路由表中的定义匹配。 检查HTTP方法
When using the 4.2.0 gem i get: ActionController::RoutingError (No route matches [GET] "/fonts/font-awesome/fontawesome-webfont.ttf"): 4.1.0 is working fine. i saw that the location of the file changed in 4.2, probably this is the proble...
McFadden Gavender is having issues with: Here is the error I'm receiving. No route matches {:action=&...