<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alexander Torrijos on Medium]]></title>
        <description><![CDATA[Stories by Alexander Torrijos on Medium]]></description>
        <link>https://medium.com/@stormwild?source=rss-c13ab7d63b38------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Mh5ZlLfADyzU69HCJegbGw.jpeg</url>
            <title>Stories by Alexander Torrijos on Medium</title>
            <link>https://medium.com/@stormwild?source=rss-c13ab7d63b38------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:27:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@stormwild/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Refactor your existing C# files to use file-scoped namespaces in bulk]]></title>
            <link>https://medium.com/@stormwild/refactor-your-existing-c-files-to-use-file-scoped-namespaces-in-bulk-1b135019c4ae?source=rss-c13ab7d63b38------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b135019c4ae</guid>
            <dc:creator><![CDATA[Alexander Torrijos]]></dc:creator>
            <pubDate>Mon, 30 Dec 2024 04:42:05 GMT</pubDate>
            <atom:updated>2024-12-30T18:17:40.023Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3XFRZZja5LXfA9JviTDoA.png" /></figure><p>To refactor your existing C# files to use file-scoped namespaces in bulk, you can use the .NET CLI tool dotnet format. This tool can apply code style preferences, including converting to file-scoped namespaces, across your entire project or solution.</p><p>Here are the steps to do this:</p><p>1. <strong>Install the .NET Format Tool:</strong> If you haven’t already installed the dotnet format tool, you can do so by running the following command in your terminal or command prompt:</p><pre>dotnet tool install -g dotnet-format</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*ctip94hQt__Z7epqDf62UA.png" /></figure><p>We can list the existing tools using the following command:</p><pre>dotnet tool list --global<br><br>Package Id                       Version         Commands<br>----------------------------------------------------------------------------<br>dotnet-format                    5.1.250801      dotnet-format</pre><p>However, starting from .NET 6 Preview 7, the dotnet format is a built-in SDK command [<a href="https://github.com/dotnet/format/issues/1268">Ref</a>].</p><pre>$ dotnet format --version<br>9.0.101-servicing.24572.9+eedb237549e0f02ec827b0905cf9231f5b4519a9<br><br>$ dotnet-format --version<br>5.1.250801+4a851ea9707f87d381166c2fc2b2d4b58a10a222</pre><p>2. <strong>Ensure .editorconfig is Configured:</strong> Make sure your .editorconfig file includes the setting for file-scoped namespaces with a severity of error:</p><pre># Code-block preferences<br>csharp_style_namespace_declarations = file_scoped:error</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*qkp32E9TXswQ2zXqfT_9yg.png" /><figcaption>.editorconfig in Visual Studio Code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*QITx7V31nPgkaFEIdV7reA.png" /><figcaption>.editorconfig in Visual Studio</figcaption></figure><p>3. <strong>Run the .NET Format Tool:</strong> Navigate to the root directory of your solution or project and run the following command:</p><pre>dotnet format FormatExample.sln --severity error</pre><p>This command will apply all code style fixes, including converting to file-scoped namespaces, based on your .editorconfig settings for severity error.</p><p>By following these steps, the dotnet format tool will automatically refactor your C# files to use file-scoped namespaces in bulk.</p><p>Here is an example of how the Todo.cs file would look after the refactor:</p><pre>namespace FormatExample.Models;<br><br>public class Todo<br>{<br>    public int Id { get; set; }<br>    public string Title { get; set; } = string.Empty;<br>    public string Description { get; set; } = string.Empty;<br>    public bool IsCompleted { get; set; }<br>    public DateTime CreatedAt { get; set; }<br><br>    public Todo(int id, string title, string description)<br>    {<br>        Id = id;<br>        Title = title;<br>        Description = description;<br>        IsCompleted = false;<br>        CreatedAt = DateTime.Now;<br>    }<br><br>    public override string ToString()<br>    {<br>        return $&quot;[{(IsCompleted ? &quot;X&quot; : &quot; &quot;)}] {Id}. {Title} - {Description} (Created: {CreatedAt:yyyy-MM-dd HH:mm})&quot;;<br>    }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5c1-c4RozUh1NR8swTzYdA.png" /><figcaption>This shows the git diff after running the command</figcaption></figure><p>You can view the history of changes in the sample repo: <a href="https://github.com/stormwild/FormatExample/commit/ab40919d66b4ec6b0af321783740291fb8e76e2a">Applied changes after running dotnet format tool · stormwild/FormatExample@ab40919</a></p><p>Reference : <a href="https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-format">dotnet format command — .NET CLI | Microsoft Learn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b135019c4ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[May Your Love Be Constant]]></title>
            <link>https://medium.com/@stormwild/may-your-love-be-constant-09e1641b9acf?source=rss-c13ab7d63b38------2</link>
            <guid isPermaLink="false">https://medium.com/p/09e1641b9acf</guid>
            <dc:creator><![CDATA[Alexander Torrijos]]></dc:creator>
            <pubDate>Mon, 02 Sep 2024 02:40:04 GMT</pubDate>
            <atom:updated>2024-12-30T06:36:10.890Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S8Sa0Fj9LJjj9LutwMdy2g.png" /></figure><p>Light is constant, but love is not.<br>The arrow of time is an illusion.<br>Our hope is to love like light.<br>To be constant.<br>So that time ceases,<br>and every moment is forever.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LN3y02yfIBZGo_97RrPZTg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09e1641b9acf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloning a folder in Git]]></title>
            <link>https://medium.com/@stormwild/cloning-a-folder-in-git-b02e63bd5cba?source=rss-c13ab7d63b38------2</link>
            <guid isPermaLink="false">https://medium.com/p/b02e63bd5cba</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[git-checkout]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git-clone]]></category>
            <dc:creator><![CDATA[Alexander Torrijos]]></dc:creator>
            <pubDate>Mon, 01 Apr 2024 04:59:54 GMT</pubDate>
            <atom:updated>2025-11-04T07:38:45.799Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VYR68EhKsEjFItBp" /></figure><h3>Git sparse checkout a specific folder from a repo</h3><p>We often want to clone only a specific folder from a large repo.</p><p>We want to download only the folder in fundamentals/minimal-apis/samples/MinApiTestsSample from the <a href="https://github.com/dotnet/AspNetCore.Docs.Samples">https://github.com/dotnet/AspNetCore.Docs.Samples</a> repository.</p><p>To clone a specific folder (subdirectory) from a Git repository, we can follow these steps:</p><ol><li>Sparse Checkout (Recommended):</li></ol><ul><li>Sparse checkout allows you to clone only specific subdirectories from a Git repository. This feature was added in Git 1.7.0.</li><li>Create a directory representing the repo.</li></ul><pre>mkdir AspNetCore.Docs.Sample<br>cd AspNetCore.Docs.Sample<br>git init<br>git remote add -f origin git@github.com:dotnet/AspNetCore.Docs.Samples.git</pre><ul><li>Enable sparse checkout:</li></ul><pre>git config core.sparseCheckout true</pre><ul><li>Define which subdirectories you want to check out by listing them in .git/info/sparse-checkout:</li></ul><pre>echo &quot;fundamentals/minimal-apis/samples/MinApiTestsSample&quot; &gt;&gt; .git/info/sparse-checkout</pre><ul><li>Update your empty repo from the remote:</li></ul><pre>git pull origin main</pre><ul><li>Only the folder you’ve added to .git/info/sparse-checkout will be checked out into your local repo.</li></ul><pre>User@Machine MINGW64 ~/source/repos/DotNet/AspNetCore.Docs.Samples (main %|SPARSE)<br>$ tree -L 5<br>.<br>`-- fundamentals<br>    `-- minimal-apis<br>        `-- samples<br>            `-- MinApiTestsSample<br>                |-- IntegrationTests<br>                |-- MinApiTestsSample.sln<br>                |-- UnitTests<br>                `-- WebMinRouteGroup<br><br>7 directories, 1 file</pre><h4>Asciinema Cast</h4><p><a href="https://asciinema.org/a/zQS4WNS0NE7JHmU5uVsjfzkVF">Git clone folder</a></p><p>If we want to add other folders to the local repo, from the repo root run the following:</p><pre>git sparse-checkout add fundamentals/middleware</pre><p>This will result in the following:</p><pre>$ tree -L 3<br>.<br>`-- fundamentals<br>    |-- middleware<br>    |   |-- problem-details-service<br>    |   `-- rate-limit<br>    `-- minimal-apis<br>        `-- samples<br><br>6 directories, 0 files</pre><p>References:</p><ul><li><a href="https://git-scm.com/docs/git-sparse-checkout">Git — git-sparse-checkout Documentation (git-scm.com)</a></li><li><a href="https://stackoverflow.com/questions/47541033/sparse-checkouts-how-does-it-works">git — Sparse checkouts — how does it works — Stack Overflow</a></li><li><a href="https://www.bing.com/copilot">Copilot</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b02e63bd5cba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Writing my first post]]></title>
            <link>https://medium.com/@stormwild/writing-my-first-post-8d165dfd582d?source=rss-c13ab7d63b38------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d165dfd582d</guid>
            <dc:creator><![CDATA[Alexander Torrijos]]></dc:creator>
            <pubDate>Wed, 19 Jul 2017 06:04:16 GMT</pubDate>
            <atom:updated>2024-12-30T05:42:24.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yy3F-1OZ7T-82wxOPentpw.png" /></figure><p>“What should I write about?”, I ask myself. Write about writing your first post, I thought. “Wow this is so meta”, another thought.</p><p>Where’s the save button?</p><p>Oh I see Saved beside the Medium logo. It’s automatic.</p><p>Awesome.</p><p>Should I click on the Publish button?</p><p>No harm in starting small. Hoping to get better over time.</p><p>Click.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d165dfd582d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>