<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Orkhan </title>
    <description>The latest articles on DEV Community by Orkhan  (@m_orkhan).</description>
    <link>https://dev.to/m_orkhan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3895275%2Ff0024a61-56b6-4ff8-9483-52f7d052b518.jpg</url>
      <title>DEV Community: Orkhan </title>
      <link>https://dev.to/m_orkhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m_orkhan"/>
    <language>en</language>
    <item>
      <title>Why Does 0.999… Equal 1? The Surprising Truth Explained Simply</title>
      <dc:creator>Orkhan </dc:creator>
      <pubDate>Fri, 24 Apr 2026 10:04:05 +0000</pubDate>
      <link>https://dev.to/m_orkhan/why-does-0999-equal-1-the-surprising-truth-explained-simply-8he</link>
      <guid>https://dev.to/m_orkhan/why-does-0999-equal-1-the-surprising-truth-explained-simply-8he</guid>
      <description>&lt;p&gt;If you’ve spent any time in a math class or browsing the internet, you’ve probably seen this statement before:&lt;br&gt;
&lt;strong&gt;0.999… equals 1.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Wait, what?&lt;br&gt;
At first glance, this feels wrong. How can something that “looks less than 1” actually be equal to 1?&lt;/p&gt;

&lt;p&gt;Let’s break it down in a way that’s easy to understand.&lt;/p&gt;

&lt;p&gt;When we write &lt;strong&gt;0.999…&lt;/strong&gt;, the “…” means the 9s go on forever. This is called a &lt;strong&gt;repeating decimal&lt;/strong&gt;. So, it’s not just 0.99 or 0.999 — there is no end to the 9s.&lt;/p&gt;

&lt;p&gt;It’s:&lt;/p&gt;

&lt;p&gt;0.9999999999999999999999… (forever!)&lt;/p&gt;

&lt;h2&gt;
  
  
  The Simple Algebra Trick
&lt;/h2&gt;

&lt;p&gt;Here’s a quick way to see why 0.999… = 1 using some basic algebra:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let’s call the repeating decimal x:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;x = 0.999…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multiply both sides by 10:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;10x = 9.999…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subtract the first equation from the second:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;10x — x = 9.999… — 0.999…&lt;br&gt;
9x = 9&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solve for x:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;x = 9 / 9&lt;br&gt;
x = 1&lt;/p&gt;

&lt;p&gt;So, &lt;strong&gt;0.999… = 1&lt;/strong&gt;. Surprised?&lt;/p&gt;

&lt;h2&gt;
  
  
  A Fraction Example
&lt;/h2&gt;

&lt;p&gt;Here’s another way to look at it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s 1 divided by 3?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1 ÷ 3 = 0.333…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now, if you multiply both sides by 3:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;0.333… × 3 = 0.999…&lt;br&gt;
1 ÷ 3 × 3 = 1&lt;/p&gt;

&lt;p&gt;So again, 0.999… = 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  But It Never Actually Reaches 1, Right?
&lt;/h2&gt;

&lt;p&gt;That’s what makes this idea tricky. Our intuition says 0.999… is just a tiny bit less than 1, but in math, if you add up more and more 9s after the decimal point, you get closer and closer to 1 — so close, in fact, that there’s &lt;strong&gt;no difference&lt;/strong&gt; between them.&lt;br&gt;
&lt;strong&gt;There is no number between 0.999… and 1.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In mathematics, they are considered exactly equal.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Big Idea: Limits
&lt;/h2&gt;

&lt;p&gt;In math, there’s a concept called a &lt;strong&gt;limit&lt;/strong&gt;. When a number gets closer and closer to a value — without ever going past it — we say it “approaches the limit.”&lt;br&gt;
0.9, 0.99, 0.999, 0.9999… all get closer and closer to 1. The limit is 1.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does This Matter?
&lt;/h2&gt;

&lt;p&gt;Understanding that 0.999… equals 1 is not just a cool math trick. It helps us see how numbers and infinity work together, and reminds us that sometimes our intuition can be fooled by how we write things down.&lt;/p&gt;

&lt;h2&gt;
  
  
  In Summary
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;0.999…&lt;/strong&gt; means “nines forever after the decimal.”&lt;br&gt;
Algebra, fractions, and the concept of limits all show us:&lt;br&gt;
&lt;strong&gt;0.999… and 1 are exactly the same number.&lt;/strong&gt;&lt;br&gt;
It’s one of those surprising truths in math —&lt;br&gt;
Infinity is full of interesting surprises!&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>math</category>
      <category>infinity</category>
    </item>
    <item>
      <title>Stop Handing Over Your Entire Wallet: DTOs in .NET Explained</title>
      <dc:creator>Orkhan </dc:creator>
      <pubDate>Fri, 24 Apr 2026 05:03:13 +0000</pubDate>
      <link>https://dev.to/m_orkhan/stop-handing-over-your-entire-wallet-dtos-in-net-explained-1eg8</link>
      <guid>https://dev.to/m_orkhan/stop-handing-over-your-entire-wallet-dtos-in-net-explained-1eg8</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;originally published at &lt;a href="https://medium.com/@orkhanmustafayev/stop-handing-over-your-entire-wallet-dtos-in-net-explained-6ddd7e1c69fa" rel="noopener noreferrer"&gt;medium&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s say you go to a coffee shop. Your coffee costs $5. Do you hand the barista your entire wallet, let them dig through your credit cards, embarrassing old photos, and loose change, and just trust them to only take the $5?&lt;/p&gt;

&lt;p&gt;Of course not. You pull out exactly what they need — the five-dollar bill — and hand it over.&lt;/p&gt;

&lt;p&gt;If you are building APIs in .NET and returning your database entities directly to the user, you are basically handing the frontend your entire wallet. You’re exposing things you shouldn’t, sending more data than necessary, and tying your database structure directly to your user interface.&lt;/p&gt;

&lt;p&gt;The solution? Data Transfer Objects (DTOs). Let’s break down exactly what they are, why you absolutely need them, and how to write them in modern .NET without overcomplicating things.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Exactly is a DTO?
&lt;/h2&gt;

&lt;p&gt;DTO stands for Data Transfer Object.&lt;br&gt;
At its core, a DTO is just a dumb, lightweight box used to carry data from one place to another — usually from your backend server to the client (like a web browser or mobile app), or vice versa.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What makes it “dumb”?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No business logic:&lt;/strong&gt;&lt;br&gt;
A DTO doesn’t calculate taxes, check if a username is already taken in the database, or know what your company’s refund policy is.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No database connections:&lt;/strong&gt;&lt;br&gt;
A DTO doesn’t know what Entity Framework is. It doesn’t save or delete things.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strictly for data (and basic bouncer duties):&lt;/strong&gt;&lt;br&gt;
It is primarily a collection of getters and setters. However, for data coming into your API, DTOs often act as the “bouncer” at the door. They handle basic input validation (e.g., checking if an email is formatted correctly or a password is long enough) to reject bad data before it ever reaches your core application.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  The 3 Big Reasons You Need DTOs
&lt;/h3&gt;

&lt;p&gt;If creating a separate class(or preferably records) just to hold data sounds like tedious extra work, I hear you. But skipping this step causes massive headaches down the road. Here is why DTOs are non-negotiable in production apps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security (Hiding Your Secrets)&lt;/strong&gt;
Imagine you have a User entity in your database. It probably looks something like this:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Username&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Email&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;PasswordHash&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;ResetToken&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If your API returns this User object directly when someone logs in, you just sent their encrypted password and a sensitive reset token straight to their web browser. A maliciou&lt;a href="https://dev.tourl"&gt;&lt;/a&gt;s user can easily open Chrome DevTools and see exactly what you sent.&lt;/p&gt;

&lt;p&gt;A UserResponseDto fixes this by only including what the client actually needs to see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;record&lt;/span&gt; &lt;span class="nc"&gt;UserResponseDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Preventing “Over-fetching” (Performance)&lt;/strong&gt;
Let’s say you are building an online store. You need a simple dropdown menu of all your products so the user can filter a search.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you return the Product database entity, you aren't just sending the product's name. You're sending the 500-word description, the weight, the supplier ID, and maybe a list of 20 high-res image URLs.&lt;/p&gt;

&lt;p&gt;Sending all that unused data across the internet wastes bandwidth, slows down your app, and runs up your cloud hosting bill. A ProductDropdownDto that only contains the Id and Name solves this instantly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Decoupling (Breaking the Tight Grip)&lt;/strong&gt;
Your database schema and your API response are two completely different things.
If you don’t use DTOs, they are bolted together. If your database administrator decides to rename the FirstName column to GivenName, your API suddenly starts spitting out GivenName. If a mobile app is relying on the old FirstName property, you just broke the mobile app.
DTOs act as a buffer. You can rename your database columns all day long, and as long as you map the new column to the old property in your DTO, the frontend doesn’t notice a thing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Write DTOs in Modern .NET
&lt;/h2&gt;

&lt;p&gt;In modern C#, the way you write a DTO usually depends on which direction the data is going: coming in (Requests) or going out (Responses).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data Going Out (Response DTOs)&lt;/strong&gt;
When you are sending data out of your API, C# records are the perfect tool for the job. They are concise and immutable by default (meaning once the data is set, it can’t be accidentally changed mid-flight).
In older versions of C#, creating DTOs (classes) was annoying because you had to write a bunch of boilerplate code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Old Way (Classes):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ProductDto&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Name&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;decimal&lt;/span&gt; &lt;span class="n"&gt;Price&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Modern .NET Way (Records):&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;public record ProductDto(int Id, string Name, decimal Price);&lt;/code&gt;&lt;br&gt;
That one line does exactly the same thing. It’s clean, it’s beautiful, and it takes two seconds to write.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data Coming In (Request DTOs)&lt;/strong&gt;
When data is coming into your API (like a user registering for an account), this is where your DTO acts as the bouncer using Input Validation. You can use Data Annotations right on the DTO to reject bad requests instantly.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;record&lt;/span&gt; &lt;span class="nc"&gt;RegisterUserDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;property&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;Required&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;MaxLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;property&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Required&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;EmailAddress&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;property&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Required&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;MinLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="n"&gt;Password&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If a user tries to send an empty email, the API automatically returns a 400 Bad Request before your database even knows what happened.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Getting Data into the Box (Mapping)&lt;/strong&gt;&lt;br&gt;
So, you have your database Entity and you have your shiny new DTO. How do you get the data from one to the other? This is called "mapping."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Method 1: Manual Mapping (The Safest Route)&lt;/strong&gt;&lt;br&gt;
You can just write the code to copy properties over yourself. This is great for performance and readability. If you are querying a database with Entity Framework Core, you can do this directly in your query using Select:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_context&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Products&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ProductDto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Price&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ToListAsync&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Method 2: Auto-Mappers (The Lazy Route)&lt;/strong&gt;&lt;br&gt;
If you have massive objects with 50 properties, typing them out manually gets old fast. Developers often use third-party libraries to map things automatically based on matching property names.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AutoMapper&lt;/strong&gt;:&lt;br&gt;
The granddaddy of them all. Very popular, but can get messy to configure in large apps.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mapster&lt;/strong&gt;:&lt;br&gt;
A much faster, more modern alternative to AutoMapper. Highly recommended if you want to go the automated route.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The Bottom Line&lt;/strong&gt;&lt;br&gt;
Yes, creating DTOs means adding more files to your project. Yes, it means you have to write a little bit of code to map data from your database models to your DTOs.&lt;/p&gt;

&lt;p&gt;But the payoff is massive. Your app becomes significantly more secure, your API payloads become lightning fast, and your frontend developers will thank you for giving them clean, predictable data structures instead of messy database tables.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>api</category>
    </item>
  </channel>
</rss>
