<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>C# on Straight from the Code</title><link>https://ivaldo.eti.br/tags/c%23/</link><description>Recent content in C# on Straight from the Code</description><generator>Hugo</generator><language>en</language><copyright>© 2025 Ivaldo de Oliveira Batista Júnior</copyright><lastBuildDate>Tue, 07 Oct 2025 09:15:00 -0300</lastBuildDate><atom:link href="https://ivaldo.eti.br/tags/c%23/index.xml" rel="self" type="application/rss+xml"/><item><title>Supercharging C# Logs with [CallerFilePath] and [CallerLineNumber]</title><link>https://ivaldo.eti.br/blog/supercharging-c%23-logs-with-callerfilepath-and-callerlinenumber/</link><pubDate>Tue, 07 Oct 2025 09:15:00 -0300</pubDate><guid>https://ivaldo.eti.br/blog/supercharging-c%23-logs-with-callerfilepath-and-callerlinenumber/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;It&amp;rsquo;s 3 AM. A critical alert wakes you up: a service in production is failing. You open the logs, desperately searching for a clue, only to find a sea of generic messages like &lt;code&gt;&amp;quot;An error occurred during processing&amp;quot;&lt;/code&gt;. Frustration mounts. Where in the thousands of lines of code did this happen? We&amp;rsquo;ve all been there. This moment is where the true value of well-structured logging becomes painfully clear.&lt;/p&gt;
&lt;p&gt;Writing good logs is an act of empathy—empathy for your future self and for the colleagues who will have to debug your code under pressure. Fortunately, the .NET platform provides powerful, yet simple, tools to turn our logs from ambiguous notes into precise, actionable information. In this article, we&amp;rsquo;ll explore how to use the &lt;code&gt;[CallerFilePath]&lt;/code&gt; and &lt;code&gt;[CallerLineNumber]&lt;/code&gt; attributes to enrich our logs, making debugging faster, more efficient, and much less stressful.&lt;/p&gt;</description></item><item><title>Hexagonal Architecture in .NET: From Controllers to Ports &amp; Adapters in a Real Project</title><link>https://ivaldo.eti.br/blog/hexagonal-architecture-in-dotnet-from-controllers-to-ports-and-adapters/</link><pubDate>Mon, 08 Sep 2025 15:15:00 -0300</pubDate><guid>https://ivaldo.eti.br/blog/hexagonal-architecture-in-dotnet-from-controllers-to-ports-and-adapters/</guid><description>&lt;h2 id="introduction-the-pain-of-coupling"&gt;Introduction: The Pain of Coupling&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;ve been developing with .NET for a while, you&amp;rsquo;ve probably seen or written a &lt;code&gt;Controller&lt;/code&gt; like this: it receives an HTTP request, validates the data, handles business logic, talks directly to Entity Framework, maybe calls another API with &lt;code&gt;HttpClient&lt;/code&gt;, and finally, returns an &lt;code&gt;ActionResult&lt;/code&gt;. At first, it seems productive. But over time, this controller becomes a monster: fragile, difficult to test, and terribly coupled to technology.&lt;/p&gt;</description></item><item><title>The Complete Guide to Logging in Blazor WASM: From Basics to Advanced with a Custom Provider</title><link>https://ivaldo.eti.br/blog/complete-guide-custom-logging-blazor-wasm/</link><pubDate>Tue, 08 Jul 2025 11:55:00 -0300</pubDate><guid>https://ivaldo.eti.br/blog/complete-guide-custom-logging-blazor-wasm/</guid><description>&lt;p&gt;If you&amp;rsquo;ve ever developed for the web, you know the feeling: a user reports an error you can&amp;rsquo;t reproduce. &amp;ldquo;Something went wrong when I tried to save,&amp;rdquo; they say. No further details. If the problem happened on the server, you likely have logs to investigate. But what if the error occurred entirely in the user&amp;rsquo;s browser? The console logs, if they ever existed, were lost forever the moment the tab was closed.&lt;/p&gt;</description></item><item><title>Mediator Design Pattern: Simplifying Interactions in Distributed Systems</title><link>https://ivaldo.eti.br/blog/mediator-design-pattern-simplifying-interactions-in-distributed-systems/</link><pubDate>Sun, 09 Jul 2023 14:35:51 -0300</pubDate><guid>https://ivaldo.eti.br/blog/mediator-design-pattern-simplifying-interactions-in-distributed-systems/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In recent years, computing has witnessed a significant shift toward distributed systems. The need for scalability, availability, and flexibility has driven the development of complex architectures where different software components interact to provide comprehensive functionalities. However, as distributed systems evolve, an inherent challenge arises: the complexity of interactions between these components.&lt;/p&gt;
&lt;p&gt;Communication between distinct parts of a distributed system is essential but often results in increased coupling between components. As new modules are added or modified, direct interactions can lead to a web of dependencies, making system maintenance and expansion an arduous task. This is where the Mediator Design Pattern comes into play.&lt;/p&gt;</description></item></channel></rss>