简体   繁体   English

从数据库中删除导致多个端点错误

[英]Deleting from database resulting in Multiple Endpoints Error

I am working on a C# E-commerce Application.我正在开发 C# 电子商务应用程序。

After I add two products to my shopping cart, I get Multiple Endpoints error when attempting to delete from the cart.将两个产品添加到购物车后,尝试从购物车中删除时出现多个端点错误。

How can I succesfully delete these items?我怎样才能成功删除这些项目? Please view the two images attached below.请查看下面附上的两张图片。

Delete From Cart Page从购物车页面删除

Internal Server error when deleting from cart从购物车中删除时出现内部服务器错误

you have two endpoit with same httpmethods(delete) and same parameter(onlineshop),you need to be unique route to avoid route conflicts.你有两个具有相同 httpmethods(删除)和相同参数(onlineshop)的端点,你需要是唯一的路由以避免路由冲突。

[HttpDelete("remove")]
public IActionResult Remove(OnlineShop model)
{ 
}
[HttpDelete("removeToChart")]
public IActionResult RemoveToChart(OnlineShop model)
{ 
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM