Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set debug point in Web API
Message
From
11/01/2017 12:17:34
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/01/2017 10:26:33
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01646521
Message ID:
01646531
Views:
53
>Hi,
>
>I have a source code of an Web API project created with API template in VS 2013. Someone else created this project.
>
>If I want to see the "flow" of classes/methods when a client calls an endpoint of this Web API (just as a way to learn more). Where (in which class and/or method) would I set the Debugger to stop, so that I can follow from this point? That is, what is the Startup class/method for typical Web API template project?
>
>TIA

Hi Dmitry,
How are you doing.

Check controllers folder. There should be blahController.cs files there (hoping it is not VB.net but C#). Open them and check the Route annotation tags, something like:

[Route("api/[controller]")]
public class BlahController : Controller

then within that you would also see HttpGet , HttpPost ... tags. Like:

[HttpGet("{id}")]
public < returntype > MyMethod(int id) {...}

That would mean, when someone makes a GET request with the path

api/BlahController/1

as an example, they are hitting that controller's given method with 1 as parameter.

Note: You can use tools like Postman to generate and test your api calls.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform