✅ MS webshop example
Hello,
Im trying to understand the different parts of a webshop example from Microsoft.
I have a question about routing, the view looks like this(see attached).
My question is regarding this line:
I find the function OrderProcess in OrderManagementController and it takes a POST-request:
To my question - how does it know in which cs file the function is located? I cant see any "connection" in the view. I cant imagine that it looks into every class to see wheter it has a OrderProcess and takes a POST-argument, but maybe im wrong? 🙂
Thanks in advance!
4 Replies
It takes the class whose method handled the
GET
request to display this form
Or rather, it POST
s to the same URL
So whichever controller handles /my/cool/form
, will handle the POST
request. And which action method will do it specifically, is denoted by asp-action
@ZZZZZZZZZZZZZZZZZZZZZZZZZ Okey, thanks!
A follow-up question, this is the start of the program:
It just returns a view but dosent specify which - am i correct by thinking it is written "under the hood" by the mapping structure? CatalogController return a view named index -> the program looks for a catalog-folder under views -> returns index view.
Attatched an image of the folder structure 🙂
Yep, exactly
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.
Closed!