In the previous post, I introduced Swagger and showed how to set up your project for Swagger. In this post I will show how to add Swagger comments to annotate your program.
In earlier posts we looked at the database of cars and the Get method that retrieves the entire list. That can be quite a lot of data going over the wire. What we want instead is to send pages. I’ll show that briefly and then we’ll annotate that code.
In the CarController we’ll have a Get method that takes three parameters: showDeleted, pageNumber and pageSize. The first we’ve seen before, it determines whether the list returned to the caller will include our deleted records. The second, pageNumber, will designate which page of data we want to return (zero based). The third parameter, pageSize, will designate how many records to return per page.
Thus, if we were to write
Get(false,3,4)
we would expect to get back records 17, 18, 19 and 20, because page 0 would have records 1-4, page 1 would have 5-8, etc.
Here is the compete endpoint that will directly call our repository (we won’t bother with a service for this example).
public async Task<IEnumerable<Car>> Get([FromRoute] bool showDeleted, int pageNumber, int pageSize )
{
return await _carRepository.Get(showDeleted, pageNumber, pageSize);
}
When the repository is called, the parameters are passed in, and it does its magic. For now, however, we are only concerned with documenting this method. We do that with XML comments, designated by three forward slash marks (///).
First, we will document the purpose of the endpoint; that is, what it does. We do that in the summary
/// <summary>
/// Get all the cars in the Database
/// </summary>
Next, we want to document the parameters
/// <param name="returnDeletedRecords">If true, the method will return all the records,
/// including the ones that have been deleted</param>
/// <param name="pageOffset">which page to display</param>
/// <param name="pageSize">how many records to display per page</param>
Finally, I’m going to document the possible response codes. Note, these are, by no means, all that you can document, but they’ll give us a good idea of how it is done
/// <response code="200">Cars returned</response>
/// <response code="404">Specified Car not found</response>
/// <response code="500">An Internal Server Error prevented the request from being executed.</response>
When an error is encountered and we return one of these codes, the text we’ve specified goes along for the ride, which is enormously helpful to the calling client.
At the top of the swagger page is our summary

At each parameter is our designated text

Finally, each of the error codes is documented

It is a best practice to document all of the endpoints. Many developers go further, and document all of the methods in both the service and the repository; that is a decision to be made by the team. Since the endpoint is the only thing visible to the client, it has the greatest claim on your time and effort. Remember, “comments rust,” and that is as true for Swagger comments as any other.






































References:
Saarbrücken
References:
https://casino-macau-venetian.online-spielhallen.de/
เนื้อหานี้
น่าสนใจดี ค่ะ
ผม ไปอ่านเพิ่มเติมเกี่ยวกับ บีเอฟคลับ
ดูต่อได้ที่ เว็บไซต์ bfclub
ลองแวะไปดู
เพราะอธิบายไว้ละเอียด
ขอบคุณที่แชร์ เนื้อหาดีๆ
และหวังว่าจะได้เห็นโพสต์แบบนี้อีก
Узнать больше
Kilogram casino промокод
References:
Blackjack guide
References:
https://online-casino-no-deposit-bonus.online-spielhallen.de/
содержание mega ссылка
References:
Casino bonusar
References:
https://top-paypal-casinos.online-spielhallen.de/
leadstore – Appreciate the typography choices; comfortable spacing improved my reading experience.
metricmarket – Pages loaded fast, images appeared sharp, and formatting stayed consistent.
strategystore – Overall, professional vibe here; trustworthy, polished, and pleasantly minimal throughout.
Get the facts aptos wallet
imp source petra aptos wallet extension
stromectol reviews ivermectin generic cream stromectol reviews
เนื้อหานี้ ให้ข้อมูลดี ครับ
ดิฉัน ได้อ่านบทความที่เกี่ยวข้องกับ เนื้อหาในแนวเดียวกัน
ซึ่งอยู่ที่ Eugenia
ลองแวะไปดู
มีตัวอย่างประกอบชัดเจน
ขอบคุณที่แชร์ เนื้อหาดีๆ นี้
และอยากเห็นบทความดีๆ แบบนี้อีก
searchlogic – Overall, professional vibe here; trustworthy, polished, and pleasantly minimal throughout.
Nicely put, Cheers. https://jsbin.com/yokenopani
keywordvault – Found practical insights today; sharing this article with colleagues later.
campaigncart – Bookmarked this immediately, planning to revisit for updates and inspiration.
rankifyer – Pages loaded fast, images appeared sharp, and formatting stayed consistent.
Модель Audemars Piguet Royal Oak известны своим уникальным дизайном.
Эту октагональный безель с видимыми винтами является подлинной легендой в часовом мире.
Данная серия была выпущена в далёком 1972-м как первые роскошные спортивные часы из нержавеющей стали.
Эта смелая концепция тогда совершила громкий переворот в часовой индустрии.
купить часы Royal Oak Audemars Piguet
Кроме внешности, часы ценятся за высочайшее исполнение обработки и механизма.
Общеизвестно, что любой экземпляр собирается вручную квалифицированными мастерами.
Сегодня Royal Oak остаются символом престижа и тонкого вкуса.
Именно так они востребованы как среди коллекционеров, так и у поклонников роскоши.
keywordking – Navigation felt smooth, found everything quickly without any confusing steps.
เนื้อหานี้ น่าสนใจดี ครับ
ดิฉัน เพิ่งเจอข้อมูลเกี่ยวกับ หัวข้อที่คล้ายกัน
สามารถอ่านได้ที่ Michell
น่าจะถูกใจใครหลายคน
เพราะให้ข้อมูลเชิงลึก
ขอบคุณที่แชร์ บทความคุณภาพ นี้
และหวังว่าจะมีข้อมูลใหม่ๆ มาแบ่งปันอีก
rankgenius – Color palette felt calming, nothing distracting, just focused, thoughtful design.
seomastery – Navigation felt smooth, found everything quickly without any confusing steps.
trafficwizard – Found practical insights today; sharing this article with colleagues later.
The flavor options for the sake of these CBD gummies and https://www.nothingbuthemp.net/collections/mushroom-gummies are impressive. Each gather tastes logical quite than disproportionately phony, and the feel is pleasantly chewy. The jug seals pantihose, which keeps them fresh and easy to store fitting for longer periods.
webstrategy – Loved the layout today; clean, simple, and genuinely user-friendly overall.
Hi! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success. If you know of any please share. Many thanks!
https://share.google/EYkVFooksGoGFcD7x
TOP 10 BEST – Navigation felt smooth, found everything quickly without any confusing steps.
brandengine – Color palette felt calming, nothing distracting, just focused, thoughtful design.
marketexperts – Pages loaded fast, images appeared sharp, and formatting stayed consistent.
conversionpro – Found practical insights today; sharing this article with colleagues later.
This CBD lubricator and best Delta 9 Beer stands out because of its cagey flatten texture and balanced taste. The bottle forge is fawning and applicable, and the dropper works strictly without dripping. It feels like a well-crafted merchandise мейд with prominence to detail, from labeling to packaging.
seoworks – Appreciate the typography choices; comfortable spacing improved my reading experience.
serpmaster – Navigation felt smooth, found everything quickly without any confusing steps.
trafficpilot – Overall, professional vibe here; trustworthy, polished, and pleasantly minimal throughout.
rankmachines – Color palette felt calming, nothing distracting, just focused, thoughtful design.
Regards, Terrific stuff. https://s3.us-east-005.backblazeb2.com/betflix22/betflix/uncategorized/betflix.html
This online square face generator is the best Picrew alternative in English — create adorable square face icons for social media and game development
ข้อมูลชุดนี้ น่าสนใจดี ค่ะ
ดิฉัน ได้อ่านบทความที่เกี่ยวข้องกับ เนื้อหาในแนวเดียวกัน
สามารถอ่านได้ที่ megaways pantip
ลองแวะไปดู
มีตัวอย่างประกอบชัดเจน
ขอบคุณที่แชร์ บทความคุณภาพ นี้
และหวังว่าจะได้เห็นโพสต์แนวนี้อีก
trafficpilot – Mobile version looks perfect; no glitches, fast scrolling, crisp text.
seoworks – Navigation felt smooth, found everything quickly without any confusing steps.
trafficforge – Navigation felt smooth, found everything quickly without any confusing steps.
rankmachines – Loved the layout today; clean, simple, and genuinely user-friendly overall.
Сейчас кроссовки завоевали огромную известность везде.
Такую обувь выбирают люди всевозможных возрастов и профессий.
Основная причина столь высокой любви — удобство и универсальность.
https://hypebeasts.ru/
Известные марки постоянно представляют новые линейки, подогревая ажиотаж.
Сникерсы прочно закрепились в уличную моду и повседневность.
С каждым сезоном их востребованность лишь увеличивается.
Appreciate the recommendation. Will try it out.
With thanks. Excellent stuff. https://files.fm/u/th5v5eyqag
mexico pharmacy: AccessBridge – AccessBridge Pharmacy
References:
Online-https://graph.org/Best-Australian-Online-Casino-2026-Ranked-04-20-bonuses
growthbots – Content reads clearly, helpful examples made concepts easy to grasp.
marketautomate – Content reads clearly, helpful examples made concepts easy to grasp.