{"id":1714,"date":"2025-12-20T13:29:19","date_gmt":"2025-12-20T13:29:19","guid":{"rendered":"https:\/\/oussamasaidi.com\/?p=1714"},"modified":"2025-12-20T13:32:47","modified_gmt":"2025-12-20T13:32:47","slug":"https-oussamasaidi-com-restful-api-mastery-best-practices-with-asp-net-core-part-2","status":"publish","type":"post","link":"https:\/\/oussamasaidi.com\/en\/https-oussamasaidi-com-restful-api-mastery-best-practices-with-asp-net-core-part-2\/","title":{"rendered":"RESTful API best practices\u00a0with ASP.NET Core Part 2"},"content":{"rendered":"<h2 class=\"wp-block-heading\">Testing, Performance, Security, Microservices &amp; Deployment <\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction: From Solid Foundations to Production Excellence<\/h2>\n\n\n\n<p>In <strong><a href=\"https:\/\/oussamasaidi.com\/en\/restful-api-mastery-best-practices-with-asp-net-core\/\" target=\"_blank\" rel=\"noopener\" title=\"RESTful API Best Practices with ASP.NET Core\">Part 1<\/a><\/strong> of RESTful API Mastery, we established the architectural and technical foundations required to build <strong>reliable, evolvable RESTful APIs<\/strong> with ASP.NET Core. However, a well-designed API only becomes truly valuable when it is <strong>tested, observable, secure, scalable, and deployable<\/strong> in real-world environments.<\/p>\n\n\n\n<p>This second part focuses on the <strong>advanced and operational aspects<\/strong> of RESTful APIs\u2014the areas where enterprise systems typically succeed or fail. These practices are widely adopted across large .NET platforms and cloud-native architectures.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"575\" src=\"https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-1024x575.png\" alt=\"RESTful API Mastery\" class=\"wp-image-1682\" srcset=\"https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-1024x575.png 1024w, https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-300x169.png 300w, https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-768x431.png 768w, https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-1536x863.png 1536w, https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-2048x1151.png 2048w, https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-18x10.png 18w, https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-256x144.png 256w, https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-950x534.png 950w, https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-1920x1079.png 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">RESTful API Mastery<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">1. API Documentation with Swagger and OpenAPI Standards<\/h2>\n\n\n\n<p>Clear documentation is not optional; it is a <strong>contract<\/strong> between API teams and consumers.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enabling OpenAPI in ASP.NET Core<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">builder.Services.AddSwaggerGen(options =>\n{\noptions.SwaggerDoc(\"v1\", new()\n{\nTitle = \"Store API\",\nVersion = \"v1\"\n});\n});<\/pre>\n\n\n\n<p>Enhancing Documentation with XML Comments<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;PropertyGroup>\n&lt;GenerateDocumentationFile>true&lt;\/GenerateDocumentationFile>\n&lt;\/PropertyGroup>\n\n\/\/\/ &lt;summary>Retrieves all available products&lt;\/summary>\n[HttpGet]\npublic IActionResult GetProducts() => Ok();<\/pre>\n\n\n\n<p><a href=\"https:\/\/oussamasaidi.com\/en\/building-professional-modern-api-documentation-in-net-core-with-scalar\/\" target=\"_blank\" rel=\"noopener\" title=\"Building Professional, Modern API Documentation in .NET Core with Scalar\">Well-documented APIs <\/a>reduce onboarding time and prevent integration errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Testing RESTful APIs: Unit, Integration, and End-to-End<\/h2>\n\n\n\n<p>Testing is a <strong>first-class engineering discipline<\/strong>, not an afterthought.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Unit Testing Controllers and Services<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[Fact]\npublic void Get_ReturnsOkResult()\n{\nvar controller = new ProductsController();\nvar result = controller.Get();\nAssert.IsType&lt;OkObjectResult>(result);\n}<\/pre>\n\n\n\n<p>Integration Testing with WebApplicationFactory<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class ProductsApiTests : IClassFixture&lt;WebApplicationFactory&lt;Program>>\n{\nprivate readonly HttpClient _client;\n\n\npublic ProductsApiTests(WebApplicationFactory&lt;Program> factory)\n{\n_client = factory.CreateClient();\n}\n}<\/pre>\n\n\n\n<p>Comprehensive testing significantly reduces production regressions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Performance Optimization Techniques for ASP.NET Core APIs<\/h2>\n\n\n\n<p>Performance optimization starts with <strong>measurement<\/strong>, not assumptions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Asynchronous Programming<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[HttpGet]\npublic async Task&lt;IActionResult> GetAsync()\n{\nvar data = await _repository.GetAsync();\nreturn Ok(data);\n}<\/pre>\n\n\n\n<p>Response Compression<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">builder.Services.AddResponseCompression();\napp.UseResponseCompression();<\/pre>\n\n\n\n<p>Combined with caching, compression delivers measurable latency improvements.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Real-World Example: Building an E-Commerce REST API<\/h2>\n\n\n\n<p>E-commerce APIs require consistency, performance, and transactional safety.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Order Creation Endpoint<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[HttpPost]\npublic async Task&lt;IActionResult> CreateOrder(CreateOrderRequest request)\n{\nvar order = await _orderService.CreateAsync(request);\nreturn CreatedAtAction(nameof(GetOrder), new { id = order.Id }, order);\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Key Considerations<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/oussamasaidi.com\/en\/how-to-build-an-idempotent-api-with-net-9-ef-core-9-and-polly-v8\/\" target=\"_blank\" rel=\"noopener\" title=\"How to Build an Idempotent API with .NET 9, EF Core 9 and Polly v8\">Idempotency <\/a>for payment operations<\/li>\n\n\n\n<li>Versioned contracts<\/li>\n\n\n\n<li>Audit-friendly logging<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">5. Microservices Communication Patterns<\/h2>\n\n\n\n<p>As systems grow, APIs rarely operate in isolation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Synchronous HTTP Communication<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Simple to implement<\/li>\n\n\n\n<li>Easy to debug<\/li>\n\n\n\n<li>Risk of cascading failures<\/li>\n<\/ul>\n\n\n\n<p>Resiliency with Polly<br><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">services.AddHttpClient(\"catalog\")\n.AddTransientHttpErrorPolicy(p =>\np.WaitAndRetryAsync(3, _ => TimeSpan.FromSeconds(2)));<\/pre>\n\n\n\n<p>Resiliency patterns are mandatory in distributed systems.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. Monitoring, Logging, and Observability<\/h2>\n\n\n\n<p>You cannot operate what you cannot observe.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Structured Logging with ILogger<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">_logger.LogInformation(\"Order {OrderId} created\", order.Id);<\/pre>\n\n\n\n<p>Health Checks<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">builder.Services.AddHealthChecks();\napp.MapHealthChecks(\"\/health\");<\/pre>\n\n\n\n<p>Observability is a prerequisite for reliability.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. Advanced Security Best Practices<\/h2>\n\n\n\n<p>Security must be layered and continuously enforced.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">HTTPS Enforcement<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">app.UseHsts();\napp.UseHttpsRedirection();<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Secure Headers and Validation<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Validate all inputs<\/li>\n\n\n\n<li>Sanitize outputs<\/li>\n\n\n\n<li>Apply least-privilege authorization<\/li>\n<\/ul>\n\n\n\n<p>Security failures are rarely caused by frameworks\u2014but by configuration gaps.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">8. Deployment Strategies for ASP.NET Core APIs<\/h2>\n\n\n\n<p>Deployment is part of API design.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Containerization with Docker<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">FROM mcr.microsoft.com\/dotnet\/aspnet:8.0\nWORKDIR \/app\nCOPY . .\nENTRYPOINT [\"dotnet\", \"Store.Api.dll\"]<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Cloud-Native Readiness<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Stateless services<\/li>\n\n\n\n<li>Externalized configuration<\/li>\n\n\n\n<li>Zero-downtime deployments<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">9. API Gateway Integration Patterns<\/h2>\n\n\n\n<p>API gateways centralize cross-cutting concerns.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Common Responsibilities<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Authentication and authorization<\/li>\n\n\n\n<li>Rate limiting<\/li>\n\n\n\n<li>Request routing<\/li>\n<\/ul>\n\n\n\n<p>Popular choices include <strong>Azure API Management<\/strong> and <strong>YARP<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">10. Future Trends and Evolving REST Best Practices<\/h2>\n\n\n\n<p>REST continues to evolve alongside the .NET ecosystem.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Emerging Trends<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hybrid REST + gRPC architectures<\/li>\n\n\n\n<li>Increased use of API gateways<\/li>\n\n\n\n<li>Contract-first development<\/li>\n<\/ul>\n\n\n\n<p>Forward-looking APIs embrace evolution without sacrificing stability.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final Conclusion: RESTful API Mastery in ASP.NET Core<\/h2>\n\n\n\n<p>With both parts combined, you now have a <strong>complete, enterprise-grade guide<\/strong> to building RESTful APIs with ASP.NET Core.<\/p>\n\n\n\n<p>True mastery comes from <strong>discipline, consistency, and operational awareness<\/strong>. When APIs are treated as long-lived products and engineered accordingly, they become powerful enablers for scalable and secure systems.<\/p>\n\n\n\n<p>REST is not outdated\u2014it is refined. And ASP.NET Core remains one of the most capable platforms to implement it correctly.<\/p>\n\n\n\n<div class=\"buy-coffee-container\">\n<p style=\"text-align:center; color:#555; font-size:14px;\">\n  If this article helped you, consider supporting my work.\n<\/p>\n  <a\n    href=\"https:\/\/buymeacoffee.com\/oussamasaii\"\n    target=\"_blank\"\n    rel=\"noopener noreferrer\"\n    class=\"buy-coffee-button\"\n  >\n    &#x2615; Buy me a coffee\n  <\/a>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Testing, Performance, Security, Microservices &amp; Deployment Introduction: From Solid Foundations to Production Excellence In Part 1 of RESTful API Mastery,&#8230; <\/p>\n<div class=\"art-el-more\"><a href=\"https:\/\/oussamasaidi.com\/en\/https-oussamasaidi-com-restful-api-mastery-best-practices-with-asp-net-core-part-2\/\" class=\"art-link art-color-link art-w-chevron\">Read more<\/a><\/div>","protected":false},"author":1,"featured_media":1681,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[40,68,45,41,56,17,90,85,84,279,82,83,42,43,98,60,20,92,91],"tags":[47,48,49,54,97,53,51,52,96],"ppma_author":[286],"class_list":["post-1714","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-netcore","category-api","category-asp-net","category-c","category-c-2","category-design","category-devops","category-docker","category-ef-core","category-en","category-entity-framework-core","category-entity-framework-core-2","category-log","category-logging","category-solid","category-swagger-ui","category-technology","category-test","category-unit-test","tag-net-core","tag-asp-net","tag-c-sharp","tag-c","tag-clean-code","tag-dot-net-core","tag-logging","tag-serilog","tag-solid"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-2r.png","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1639,"url":"https:\/\/oussamasaidi.com\/en\/restful-api-mastery-best-practices-with-asp-net-core\/","url_meta":{"origin":1714,"position":0},"title":"RESTful API Best Practices with ASP.NET Core","author":"Saidi Oussama","date":"December 16, 2025","format":false,"excerpt":"Professional Best Practices, Versioning Strategies & Advanced Serialization (Part 1) In this blog Introduction: Building Enterprise-Grade RESTful APIs with ASP.NET Core1. RESTful APIs in the Modern ASP.NET Core EcosystemWhy REST Still Dominates2. REST Architectural Constraints Every ASP.NET Core API Must EnforceClient\u2013Server SeparationStatelessnessUniform Interface3. Establishing a Clean and Scalable ASP.NET Core\u2026","rel":"","context":"In &quot;.Net Core&quot;","block_context":{"text":".Net Core","link":"https:\/\/oussamasaidi.com\/en\/category\/netcore\/"},"img":{"alt_text":"RESTful API Mastery","src":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-scaled.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-scaled.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-scaled.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-scaled.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-scaled.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/restful-api-mastery-best-practices-with-asp-net-core-cover-scaled.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1406,"url":"https:\/\/oussamasaidi.com\/en\/net-8-test-driven-design-architecture-7-proven-patterns-to-build-robust-maintainable-systems\/","url_meta":{"origin":1714,"position":1},"title":"Net 8 Test Driven Design Architecture 7 Proven Patterns to Build Robust, Maintainable Systems","author":"Saidi Oussama","date":"November 25, 2025","format":false,"excerpt":"Introduction to Test Driven Design \u2014 What this guide covers If you want a battle-tested approach to designing systems that are maintainable, testable, and production-ready, .Net 8 Test Driven Design Architecture combines the stability of .NET 8 with Test Driven Design discipline and modern architecture patterns. This guide gives patterns,\u2026","rel":"","context":"In &quot;.Net Core&quot;","block_context":{"text":".Net Core","link":"https:\/\/oussamasaidi.com\/en\/category\/netcore\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/dot-net-8-tdd-architecture-article-cover.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/dot-net-8-tdd-architecture-article-cover.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/dot-net-8-tdd-architecture-article-cover.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/dot-net-8-tdd-architecture-article-cover.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/dot-net-8-tdd-architecture-article-cover.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/dot-net-8-tdd-architecture-article-cover.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1325,"url":"https:\/\/oussamasaidi.com\/en\/building-professional-modern-api-documentation-in-net-core-with-scalar\/","url_meta":{"origin":1714,"position":2},"title":"Building Professional, Modern API Documentation in .NET Core with Scalar","author":"Saidi Oussama","date":"November 19, 2025","format":false,"excerpt":"Introduction In today\u2019s software ecosystem, APIs are everywhere. Whether you are building a mobile application, a microservices architecture, or an internal company platform, your API is often the backbone of the system. But even the best API becomes useless if developers cannot understand how to consume it. This is why\u2026","rel":"","context":"In &quot;.Net Core&quot;","block_context":{"text":".Net Core","link":"https:\/\/oussamasaidi.com\/en\/category\/netcore\/"},"img":{"alt_text":"Building Professional, Modern API Documentation in .NET Core with Scalar","src":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/Building-Professional-Modern-API-Documentation-in-.NET-Core-with-Scalar.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/Building-Professional-Modern-API-Documentation-in-.NET-Core-with-Scalar.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/Building-Professional-Modern-API-Documentation-in-.NET-Core-with-Scalar.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/Building-Professional-Modern-API-Documentation-in-.NET-Core-with-Scalar.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/Building-Professional-Modern-API-Documentation-in-.NET-Core-with-Scalar.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/Building-Professional-Modern-API-Documentation-in-.NET-Core-with-Scalar.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1254,"url":"https:\/\/oussamasaidi.com\/en\/how-to-build-an-idempotent-api-with-net-9-ef-core-9-and-polly-v8\/","url_meta":{"origin":1714,"position":3},"title":"How to Build an Idempotent API with .NET 9, EF Core 9 and Polly v8","author":"Saidi Oussama","date":"November 6, 2025","format":false,"excerpt":"Introduction Have you ever hit \u201cPay\u201d on a checkout page, the page froze, and you clicked again \u2014 only to be charged twice?That\u2019s exactly what idempotency prevents. In distributed and cloud-native architectures, duplicate requests happen often: client-side retries (mobile poor signal), API Gateway or load-balancer retries, users refreshing a browser\u2026","rel":"","context":"In &quot;.Net Core&quot;","block_context":{"text":".Net Core","link":"https:\/\/oussamasaidi.com\/en\/category\/netcore\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/oussama-saidi-tuto-net-core-rest-api-Idempotent-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/oussama-saidi-tuto-net-core-rest-api-Idempotent-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/oussama-saidi-tuto-net-core-rest-api-Idempotent-1.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/oussama-saidi-tuto-net-core-rest-api-Idempotent-1.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/oussama-saidi-tuto-net-core-rest-api-Idempotent-1.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/11\/oussama-saidi-tuto-net-core-rest-api-Idempotent-1.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1565,"url":"https:\/\/oussamasaidi.com\/en\/securing-sensitive-information-in-net-core\/","url_meta":{"origin":1714,"position":4},"title":"Securing Sensitive Information in .NET Core: A Complete Guide for Developers","author":"Saidi Oussama","date":"December 8, 2025","format":false,"excerpt":"Protecting user data is one of the most critical responsibilities of any software developer. In today\u2019s connected world, even a small leakage of sensitive information \u2014 API keys, passwords, or tokens \u2014 can have devastating consequences. Fortunately, .NET Core (or .NET 9 and later) offers several mechanisms to help you\u2026","rel":"","context":"In &quot;.Net Core&quot;","block_context":{"text":".Net Core","link":"https:\/\/oussamasaidi.com\/en\/category\/netcore\/"},"img":{"alt_text":"Securing sensitive Information in .NET Core","src":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/securing-sensitive-information-in-net-core.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/securing-sensitive-information-in-net-core.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/securing-sensitive-information-in-net-core.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/securing-sensitive-information-in-net-core.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2025\/12\/securing-sensitive-information-in-net-core.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":838,"url":"https:\/\/oussamasaidi.com\/en\/comment-implementer-authentification-cle-api-aspnet-core\/","url_meta":{"origin":1714,"position":5},"title":".NET Core : impl\u00e9menter l\u2019authentification par cl\u00e9 API en C#","author":"Saidi Oussama","date":"August 22, 2024","format":false,"excerpt":"ContexteCr\u00e9ation de l'attribut de cl\u00e9 APIImpl\u00e9menter du filtre d'autorisation ApiKeyimpl\u00e9mentation de l'ApiKeyValidatorTester l'APIUtilisez le middlewareConclusionDerniers Articles Vous pouvez trouver le code source complet sur github Contexte Alors, qu\u2019est-ce que l\u2019authentification par cl\u00e9 API dans ASP.NET Core ? Prenons un exemple concret. Imaginez que vous ayez d\u00e9velopp\u00e9 un tableau de bord\u2026","rel":"","context":"In &quot;.Net Core&quot;","block_context":{"text":".Net Core","link":"https:\/\/oussamasaidi.com\/en\/category\/netcore\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2024\/07\/Capture00.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2024\/07\/Capture00.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/oussamasaidi.com\/wp-content\/uploads\/2024\/07\/Capture00.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"authors":[{"term_id":286,"user_id":1,"is_guest":0,"slug":"oussama_sa","display_name":"Saidi Oussama","avatar_url":{"url":"https:\/\/oussamasaidi.com\/wp-content\/uploads\/2022\/02\/001_001_cv1.jpg","url2x":"https:\/\/oussamasaidi.com\/wp-content\/uploads\/2022\/02\/001_001_cv1.jpg"},"author_category":"1","first_name":"Oussama","last_name":"SAIDI","user_url":"https:\/\/oussamasaidi.com","job_title":"Senior Fullstack .NET Developer","description":"I\u2019m a Senior Fullstack .NET Developer specializing in building scalable, high-performance web applications with .NET, C#, and modern frontend frameworks like React.js. I\u2019m passionate about clean architecture, automated testing, and sharing knowledge through blogs and tutorials."}],"_links":{"self":[{"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/posts\/1714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/comments?post=1714"}],"version-history":[{"count":22,"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/posts\/1714\/revisions"}],"predecessor-version":[{"id":1749,"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/posts\/1714\/revisions\/1749"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/media\/1681"}],"wp:attachment":[{"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/media?parent=1714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/categories?post=1714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/tags?post=1714"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/oussamasaidi.com\/en\/wp-json\/wp\/v2\/ppma_author?post=1714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}