<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>.NET on runaho.dev</title><link>https://52b71935.runaho-dev.pages.dev/categories/.net/</link><description>Recent content in .NET on runaho.dev</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 07 Oct 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://52b71935.runaho-dev.pages.dev/categories/.net/index.xml" rel="self" type="application/rss+xml"/><item><title>Using HttpResults.Results for Minimal API Methods with MiniValidator in .NET Core</title><link>https://52b71935.runaho-dev.pages.dev/engineering/minimal-api-minivalidator-dotnet/</link><pubDate>Sat, 07 Oct 2023 00:00:00 +0000</pubDate><guid>https://52b71935.runaho-dev.pages.dev/engineering/minimal-api-minivalidator-dotnet/</guid><description>&lt;h1 id="about-the-post" class="relative group"&gt;About the post &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#about-the-post" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;In this blog post, I will show you how to use HttpResults.Results for Minimal API Methods in &lt;code&gt;.NET Core HttpResults.Results&lt;/code&gt; is a class that provides a set of typed results for common scenarios, such as Ok, BadRequest, Problem, ValidationProblem, etc. These results can be used to return consistent and meaningful responses from your API methods, without having to write a lot of boilerplate code.&lt;/p&gt;</description></item><item><title>How to access files in the backend on .NET Core?</title><link>https://52b71935.runaho-dev.pages.dev/engineering/dotnet-backend-file-access/</link><pubDate>Fri, 26 Nov 2021 00:00:00 +0000</pubDate><guid>https://52b71935.runaho-dev.pages.dev/engineering/dotnet-backend-file-access/</guid><description>&lt;p&gt;Hi, in this article, we will look at how we can access files when we want to do operations such as reading, writing, etc. with .NET Core.&lt;/p&gt;
&lt;h2 id="how-to-access-a-file-in-wwwroot" class="relative group"&gt;How to access a file in wwwroot? &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#how-to-access-a-file-in-wwwroot" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;The first thing you need to do is to set the IWebHostEnvironment interface as a parameter to the construction field of your page or class and set it as private readonly. In this way, we can use it wherever we want after the page is initialized.&lt;/p&gt;</description></item><item><title>How to Use Session in .NET Core?</title><link>https://52b71935.runaho-dev.pages.dev/engineering/dotnet-core-session/</link><pubDate>Thu, 25 Nov 2021 00:00:00 +0000</pubDate><guid>https://52b71935.runaho-dev.pages.dev/engineering/dotnet-core-session/</guid><description>&lt;p&gt;Hello, in this article we will look at how we can use session with .net core.&lt;/p&gt;
&lt;p&gt;If you, like me, have spent a lot of time with the .net framework for a long time, and a session is a must.&lt;/p&gt;
&lt;h2 id="so-lets-see-how-to-implement-session-in-net-core" class="relative group"&gt;So let’s see how to implement Session in Net Core &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100"&gt;&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#so-lets-see-how-to-implement-session-in-net-core" aria-label="Anchor"&gt;#&lt;/a&gt;&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;To use Session in .Net Core, we first need to go to Startup.cs and find the ConfigureServices Method.&lt;/p&gt;</description></item><item><title>I left the Web Form and switched to Razor Pages.</title><link>https://52b71935.runaho-dev.pages.dev/engineering/webforms-to-razor-pages/</link><pubDate>Tue, 23 Nov 2021 00:00:00 +0000</pubDate><guid>https://52b71935.runaho-dev.pages.dev/engineering/webforms-to-razor-pages/</guid><description>&lt;p&gt;Hi, in this article, I will talk about my thoughts about .NET Core Razor Pages, its pros, cons and what it adds to me, and I wish you a pleasant reading.&lt;/p&gt;
&lt;p&gt;If you are in the process of change like me or are wondering about my change, it will be a long article.&lt;/p&gt;
&lt;p&gt;If I have to talk about myself, I have been developing web applications with Web Forms technology since 2015. Time and time, I was looking at MVC and finding it too complex for the projects I developed, so I was used in one or two projects and walked away. If you don’t have an old but incredibly large project as an ORM, I would establish my database relations with the LINQ 2 Data Context, which does not cause problems and even saves a lot of time, I would develop Procedure-based database architecture and separate SQL from C# as much as possible.&lt;/p&gt;</description></item></channel></rss>