I'm new to MVC so I was struggling with the title of the question -- not sure if there's anything already covering what I want to do.
Suppose I have a controller: FooController. It handles a set of views, all of which do the same basic thing, but use different models for various reasons. So I create an action for each model, and this works well:
[HttpPost]
public ActionResult Bar(Type1 t);
[HttpPost]
public ActionResult Bar(Type2 t);
etc...
What I want to accomplish (if possible) is to create an action that can accept a POST from a 3rd party website (in addition to the typed-views locally) and I can't seem to figure out how to accept the data without MVC throwing an exception:
The current request for action 'Bar' on controller type 'FooController' is ambiguous between the following action methods:
And it lists the above actions.
I've tried a couple things:
- Created a method Bar(ExternalSiteType t) - Exception
- Created a method Bar(ExternalSiteParam1 p, ExternalSiteParam2 p2) - Exception
- Commented out the other actions - Success for both methods above
Any ideas how to get this to work?
EDIT: Route examples
/Foo/Bar/Type1
/Foo/Bar/Type2
/Foo/Bar/ExternalSite