Click here to Skip to main content
15,947,958 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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 successfully delete these items? Please view the two images attached below.

https://i.stack.imgur.com/lpRq2.png

https://i.stack.imgur.com/JTOIP.png

What I have tried:

I have attempted deleting records from the users shopping cart.
Posted
Updated 13-Nov-22 10:03am
Comments
Member 15627495 13-Nov-22 5:23am    
we can't help you by not enough information.

How is your cart content made ?
what is the query to delete from db ?
without those information, even guessing your solution is far from your code..
please , add informations to your request here.

1 solution

The error message is very clear, you have 2 endpoints with different names but with the same method signature.

To quote AmbiguousMatchException Class (System.Reflection) | Microsoft Learn[^]

An AmbiguousMatchException is thrown when a member is invoked late-bound and multiple overloads satisfy the binding criteria, or when more than one member matches the binding criteria passed to a reflection method that can return only a single result (for example, Type.GetMethod or Type.GetProperty).

It also points to the 2 methods that have the conflict:
* HomeController.Remove
* HomeController.RemoveToCart

Change the parameters of one of the methods to remove the conflict. No code was supplied, so can't advise what to change.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900