简体   繁体   中英

Deleting from database resulting in Multiple Endpoints Error

I am working on a C# E-commerce Application.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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