<?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: Umer Farooq</title>
    <description>The latest articles on DEV Community by Umer Farooq (@umerfarooqofficial).</description>
    <link>https://dev.to/umerfarooqofficial</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3542509%2F780b5929-40ef-4b0d-8965-2b16adab8a7e.png</url>
      <title>DEV Community: Umer Farooq</title>
      <link>https://dev.to/umerfarooqofficial</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/umerfarooqofficial"/>
    <language>en</language>
    <item>
      <title>One Line of EF Core Config Cut My Query’s Reads by 99%</title>
      <dc:creator>Umer Farooq</dc:creator>
      <pubDate>Wed, 11 Nov 2026 23:59:12 +0000</pubDate>
      <link>https://dev.to/umerfarooqofficial/one-line-of-ef-core-config-cut-my-querys-reads-by-99-1pc6</link>
      <guid>https://dev.to/umerfarooqofficial/one-line-of-ef-core-config-cut-my-querys-reads-by-99-1pc6</guid>
      <description>&lt;p&gt;Your EF Core query is correct. It returns the right row. The column has an index.&lt;/p&gt;

&lt;p&gt;And SQL Server still reads the whole index to find one row.&lt;/p&gt;

&lt;p&gt;The cause is one EF Core default that most C# developers never think about. In this post, I will show you the problem with a real demo, the one-line fix, and a checklist to find it in your own project.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; EF Core sends C# strings as &lt;code&gt;nvarchar&lt;/code&gt; by default. If your column is &lt;code&gt;varchar&lt;/code&gt;, SQL Server converts the column and can scan the whole index. In my demo, one line of configuration, &lt;code&gt;.IsUnicode(false)&lt;/code&gt;, cut logical reads from 887 to 3.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;Here is a simple table. The &lt;code&gt;Email&lt;/code&gt; column is &lt;code&gt;VARCHAR&lt;/code&gt;, and it has an index.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Customers&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nc"&gt;Id&lt;/span&gt;       &lt;span class="kt"&gt;INT&lt;/span&gt; &lt;span class="no"&gt;IDENTITY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;Email&lt;/span&gt;    &lt;span class="kt"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;COLLATE&lt;/span&gt; &lt;span class="nc"&gt;SQL_Latin1_General_CP1_CI_AS&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;FullName&lt;/span&gt; &lt;span class="kt"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="nc"&gt;IX_Customers_Email&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Customers&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Email&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;I filled it with 200,000 rows of test data.&lt;/p&gt;

&lt;p&gt;And here is a normal EF Core entity with a normal query.&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;Customer&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="nc"&gt;Id&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&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="nc"&gt;Email&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&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="nc"&gt;FullName&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Customers&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Email&lt;/span&gt; &lt;span class="o"&gt;==&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="nc"&gt;Select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;FirstOrDefaultAsync&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;Nothing looks wrong. That is exactly the problem.&lt;/p&gt;


&lt;h2&gt;
  
  
  What EF Core Actually Sends
&lt;/h2&gt;

&lt;p&gt;C# strings are Unicode. So unless you tell it otherwise, EF Core maps a &lt;code&gt;string&lt;/code&gt; property to &lt;code&gt;nvarchar&lt;/code&gt; and sends the parameter as &lt;code&gt;nvarchar&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With sensitive data logging turned on in my demo, EF Core logged this:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Executed DbCommand (272ms) [Parameters=[@email='user150000@example.com' (Size = 4000)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [c].[Id]
FROM [Customers] AS [c]
WHERE [c].[Email] = @email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;Size = 4000&lt;/code&gt; with no &lt;code&gt;DbType&lt;/code&gt; shown means a Unicode string: an &lt;code&gt;NVARCHAR(4000)&lt;/code&gt; parameter.&lt;/p&gt;

&lt;p&gt;The column is &lt;code&gt;VARCHAR&lt;/code&gt;. The parameter is &lt;code&gt;NVARCHAR&lt;/code&gt;. They do not match.&lt;/p&gt;

&lt;p&gt;A small bonus detail from my first run: when the value was a C# &lt;code&gt;const&lt;/code&gt;, EF Core did not send a parameter at all. It inlined the value into the SQL as &lt;code&gt;N'user150000@example.com'&lt;/code&gt;. That &lt;code&gt;N&lt;/code&gt; prefix makes it an &lt;code&gt;NVARCHAR&lt;/code&gt; literal, so the result was exactly the same scan. Constant or variable, the default mapping produces the mismatch.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why That Hurts the Index
&lt;/h2&gt;

&lt;p&gt;When SQL Server compares two different types, it converts one of them. &lt;code&gt;NVARCHAR&lt;/code&gt; has higher data type precedence than &lt;code&gt;VARCHAR&lt;/code&gt;, so SQL Server converts &lt;strong&gt;the column&lt;/strong&gt;, not the parameter.&lt;/p&gt;

&lt;p&gt;Converting the column means SQL Server cannot simply jump to the matching value in the index. With a SQL collation like the one in my demo, it scans the index and converts every value as it goes.&lt;/p&gt;

&lt;p&gt;Here are the actual execution plans. Query 1 uses an &lt;code&gt;NVARCHAR&lt;/code&gt; parameter, like EF Core's default. Query 2 uses a &lt;code&gt;VARCHAR&lt;/code&gt; parameter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F53ey7iff2g35yiji7q5x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F53ey7iff2g35yiji7q5x.png" alt="Two execution plans: Query 1 with the nvarchar parameter uses an Index Scan with a warning and costs 100 percent of the batch, Query 2 with the varchar parameter uses an Index Seek and costs 0 percent" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;
Same query, same index. Only the parameter type changed: Index Scan for query 1, Index Seek for query 2.



&lt;p&gt;&lt;br&gt;&lt;br&gt;
Look at the first plan closely, and two things stand out:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A yellow warning triangle on the &lt;code&gt;SELECT&lt;/code&gt; operator.&lt;/li&gt;
&lt;li&gt;The query cost: 100% of the batch, while the &lt;code&gt;VARCHAR&lt;/code&gt; version costs 0%.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The warning is SQL Server's hint that something is wrong. To see exactly what, hover over the Index Scan:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmxg4vx2lb3cmba5vshyw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmxg4vx2lb3cmba5vshyw.png" alt="Index Scan tooltip showing 200000 rows read for 1 actual row, with the predicate CONVERT_IMPLICIT nvarchar 100 applied to the Email column" width="357" height="578"&gt;&lt;/a&gt;&lt;/p&gt;
The scan read 200,000 rows to return 1. Look at the CONVERT_IMPLICIT predicate at the bottom.



&lt;p&gt;&lt;br&gt;&lt;br&gt;
Look at the &lt;strong&gt;Predicate&lt;/strong&gt; at the bottom: &lt;code&gt;CONVERT_IMPLICIT(nvarchar(100), [Email], 0) = [@nv]&lt;/code&gt;. SQL Server converted the &lt;code&gt;Email&lt;/code&gt; column itself, on every row, and read &lt;strong&gt;200,000 rows to return 1&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now the seek:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjyvp12oyb1148qx7ubz7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjyvp12oyb1148qx7ubz7.png" alt="Index Seek tooltip showing 1 row read for 1 actual row, using a seek predicate on the Email column" width="361" height="575"&gt;&lt;/a&gt;&lt;/p&gt;
The seek read exactly 1 row. No conversion.



&lt;p&gt;&lt;br&gt;&lt;br&gt;
One row read. No conversion.&lt;/p&gt;

&lt;p&gt;One small note: with Windows collations, SQL Server can sometimes still do a seek after the conversion. It is less dramatic there, but the mismatch still adds work. The fix is the same either way.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Numbers From My Demo
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Measurement&lt;/th&gt;
&lt;th&gt;nvarchar parameter&lt;/th&gt;
&lt;th&gt;varchar parameter&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Plan operator&lt;/td&gt;
&lt;td&gt;Index Scan&lt;/td&gt;
&lt;td&gt;Index Seek&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rows read&lt;/td&gt;
&lt;td&gt;200,000&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Logical reads&lt;/td&gt;
&lt;td&gt;887&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;200 queries from EF Core&lt;/td&gt;
&lt;td&gt;3,408 ms&lt;/td&gt;
&lt;td&gt;130 ms&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;SQL Server read 200,000 rows to return one. Logical reads dropped from 887 to 3, a reduction of more than 99%, and the plan's share of the batch cost went from 100% to 0%. Running the same EF Core query 200 times took 3,408 ms before the fix and 130 ms after, about 26 times faster.&lt;/p&gt;

&lt;p&gt;These numbers come from a demo table on my laptop, using SQL Server 2016 LocalDB (13.0.7037), .NET 10 and EF Core 10.0.15. A real production table can be much bigger, and the gap grows with it.&lt;/p&gt;


&lt;h2&gt;
  
  
  The One-Line Fix
&lt;/h2&gt;

&lt;p&gt;Tell EF Core the column is not Unicode.&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="n"&gt;modelBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Entity&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Customer&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&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;span class="nc"&gt;Property&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IsUnicode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HasMaxLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&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;After this change, EF Core logged:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Executed DbCommand (8ms) [Parameters=[@email='user150000@example.com' (Size = 100) (DbType = AnsiString)], CommandType='Text', CommandTimeout='30']
SELECT TOP(1) [c].[Id]
FROM [Customers] AS [c]
WHERE [c].[Email] = @email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;DbType = AnsiString&lt;/code&gt; means &lt;code&gt;VARCHAR&lt;/code&gt;, and &lt;code&gt;Size = 100&lt;/code&gt; matches the column. The types match, and SQL Server goes back to an index seek.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;HasMaxLength(100)&lt;/code&gt; is optional for the seek, but it makes the parameter size match the column too, which keeps your query plans consistent.&lt;/p&gt;
&lt;h3&gt;
  
  
  Other ways to say the same thing
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Option A: Data annotation (EF Core 6 and newer)
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Unicode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&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;span class="nc"&gt;MaxLength&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&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="nc"&gt;Email&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;set&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Option B: Column type
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Property&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;HasColumnType&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"varchar(100)"&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;h4&gt;
  
  
  Option C: A whole database that uses &lt;code&gt;varchar&lt;/code&gt; everywhere
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;protected&lt;/span&gt; &lt;span class="k"&gt;override&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nc"&gt;ConfigureConventions&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;ModelConfigurationBuilder&lt;/span&gt; &lt;span class="n"&gt;configurationBuilder&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;configurationBuilder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Properties&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&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;span class="nc"&gt;AreUnicode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&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;Use Option C carefully. It applies to every string property, including new columns your migrations create.&lt;/p&gt;


&lt;h2&gt;
  
  
  Where This Usually Happens
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hand-written models on an existing database.&lt;/strong&gt; Legacy databases often use &lt;code&gt;varchar&lt;/code&gt;, while the C# model was written by hand without saying so.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code that grew over years.&lt;/strong&gt; One team adds a &lt;code&gt;varchar&lt;/code&gt; column in SQL, another maps it in C# later.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you scaffold your model from the database with &lt;code&gt;Scaffold-DbContext&lt;/code&gt;, EF Core usually adds &lt;code&gt;IsUnicode(false)&lt;/code&gt; for &lt;code&gt;varchar&lt;/code&gt; columns for you. The risk is mostly in models written or edited by hand.&lt;/p&gt;


&lt;h2&gt;
  
  
  It Is Not Only EF Core
&lt;/h2&gt;

&lt;p&gt;The same trap exists in other data access code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dapper&lt;/strong&gt; sends strings as &lt;code&gt;nvarchar&lt;/code&gt; by default too. Use &lt;code&gt;DbString&lt;/code&gt; for &lt;code&gt;varchar&lt;/code&gt; columns:&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="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;QueryFirstOrDefaultAsync&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s2"&gt;"SELECT Id FROM dbo.Customers WHERE Email = @Email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;DbString&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Value&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;IsAnsi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&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;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;ADO.NET&lt;/strong&gt; has the same problem with &lt;code&gt;AddWithValue&lt;/code&gt;, which infers &lt;code&gt;NVarChar&lt;/code&gt; from a C# string. Set the type yourself:&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="c1"&gt;// Avoid: infers NVarChar&lt;/span&gt;
&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Parameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AddWithValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"@Email"&lt;/span&gt;&lt;span class="p"&gt;,&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="c1"&gt;// Prefer: matches the column exactly&lt;/span&gt;
&lt;span class="n"&gt;command&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Parameters&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"@Email"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;SqlDbType&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;VarChar&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Value&lt;/span&gt; &lt;span class="o"&gt;=&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;h2&gt;
  
  
  Checklist: Find This in Your Own Project
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: List your &lt;code&gt;varchar&lt;/code&gt; and &lt;code&gt;char&lt;/code&gt; columns.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="no"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;COLUMN_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;DATA_TYPE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;CHARACTER_MAXIMUM_LENGTH&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="no"&gt;INFORMATION_SCHEMA&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;COLUMNS&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="no"&gt;DATA_TYPE&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'varchar'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'char'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="no"&gt;TABLE_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;COLUMN_NAME&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;Step 2: Check the matching C# properties.&lt;/strong&gt; Each one should have &lt;code&gt;IsUnicode(false)&lt;/code&gt;, &lt;code&gt;[Unicode(false)]&lt;/code&gt;, or a &lt;code&gt;varchar&lt;/code&gt; column type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Check your EF Core logs in development.&lt;/strong&gt; With &lt;code&gt;EnableSensitiveDataLogging()&lt;/code&gt;, look at the parameter types for queries on those columns. &lt;code&gt;DbType = AnsiString&lt;/code&gt; is good. A plain &lt;code&gt;Size = 4000&lt;/code&gt; on a &lt;code&gt;varchar&lt;/code&gt; column is the problem. Never turn sensitive data logging on in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Search the plan cache for implicit conversions.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="no"&gt;TOP&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execution_count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;total_logical_reads&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;text&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;query_text&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dm_exec_query_stats&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;qs&lt;/span&gt;
&lt;span class="k"&gt;CROSS&lt;/span&gt; &lt;span class="no"&gt;APPLY&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dm_exec_sql_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sql_handle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;
&lt;span class="k"&gt;CROSS&lt;/span&gt; &lt;span class="no"&gt;APPLY&lt;/span&gt; &lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dm_exec_query_plan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plan_handle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;qp&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="nb"&gt;CAST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;qp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query_plan&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="no"&gt;NVARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;MAX&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;LIKE&lt;/span&gt; &lt;span class="no"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'%CONVERT_IMPLICIT%'&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;qs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;total_logical_reads&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Not every &lt;code&gt;CONVERT_IMPLICIT&lt;/code&gt; is a problem. Look for the ones applied to a &lt;strong&gt;column&lt;/strong&gt; in a &lt;code&gt;WHERE&lt;/code&gt; or &lt;code&gt;JOIN&lt;/code&gt;. This query can be heavy on a busy server, so run it at a quiet time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Check Dapper and ADO.NET code&lt;/strong&gt; for string parameters sent to &lt;code&gt;varchar&lt;/code&gt; columns.&lt;/p&gt;


&lt;h2&gt;
  
  
  Quick Reference
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You have&lt;/th&gt;
&lt;th&gt;Do this&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EF Core, one property&lt;/td&gt;
&lt;td&gt;&lt;code&gt;.IsUnicode(false).HasMaxLength(n)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EF Core, attribute style&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;[Unicode(false)]&lt;/code&gt; and &lt;code&gt;[MaxLength(n)]&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EF Core, whole database is varchar&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Properties&amp;lt;string&amp;gt;().AreUnicode(false)&lt;/code&gt; in &lt;code&gt;ConfigureConventions&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dapper&lt;/td&gt;
&lt;td&gt;&lt;code&gt;new DbString { Value = x, IsAnsi = true, Length = n }&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADO.NET&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Parameters.Add("@p", SqlDbType.VarChar, n)&lt;/code&gt; instead of &lt;code&gt;AddWithValue&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Column really needs Unicode&lt;/td&gt;
&lt;td&gt;Change the column to &lt;code&gt;nvarchar&lt;/code&gt; instead&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That last row matters. If a column stores names or text in many languages, the right fix may be to make the column &lt;code&gt;nvarchar&lt;/code&gt;, not to make the parameter &lt;code&gt;varchar&lt;/code&gt;. Match the types to the data, not the other way around.&lt;/p&gt;


&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;A correct query can still be a slow query.&lt;/li&gt;
&lt;li&gt;EF Core sends strings as &lt;code&gt;nvarchar&lt;/code&gt; unless your model says otherwise.&lt;/li&gt;
&lt;li&gt;When the types do not match, SQL Server converts the column, and the index cannot be used efficiently.&lt;/li&gt;
&lt;li&gt;One line of configuration fixes it.&lt;/li&gt;
&lt;li&gt;The same trap exists in Dapper and ADO.NET.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  Over to You
&lt;/h2&gt;

&lt;p&gt;Have you ever found an implicit conversion hiding in a slow query? Was it EF Core, Dapper, or something else? Tell me in the comments.&lt;/p&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Thanks for reading!&lt;/strong&gt; 🙏&lt;/p&gt;

&lt;p&gt;If this saved you a slow query, a reaction or a bookmark helps other C# developers find it too.&lt;/p&gt;

&lt;p&gt;I write about real-world .NET, C# and SQL Server lessons every week. Follow me so you do not miss the next one.&lt;/p&gt;

&lt;p&gt;📧 Hiring a .NET developer who enjoys problems like this? Email me at &lt;a href="mailto:contact@umerfarooqofficial.com"&gt;contact@umerfarooqofficial.com&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__3542509"&gt;
    &lt;a href="/umerfarooqofficial" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3542509%2F780b5929-40ef-4b0d-8965-2b16adab8a7e.png" alt="umerfarooqofficial image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/umerfarooqofficial"&gt;Umer Farooq&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/umerfarooqofficial"&gt;Senior .NET developer. Building real-world .NET systems since 2016. I write about what production taught me.&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;br&gt;
&lt;/blockquote&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>sql</category>
      <category>sqlserver</category>
    </item>
    <item>
      <title>From Check-In to Check-Out in a .NET Visitor System</title>
      <dc:creator>Umer Farooq</dc:creator>
      <pubDate>Wed, 04 Nov 2026 11:15:33 +0000</pubDate>
      <link>https://dev.to/umerfarooqofficial/from-check-in-to-check-out-in-a-net-visitor-system-3j0c</link>
      <guid>https://dev.to/umerfarooqofficial/from-check-in-to-check-out-in-a-net-visitor-system-3j0c</guid>
      <description>&lt;p&gt;In &lt;a href="https://dev.to/umerfarooqofficial/i-took-over-a-net-visitor-system-with-face-recognition-5bnc"&gt;part 1&lt;/a&gt;, I showed how this visitor management system was put together: a WPF reception app, face recognition, ID card scanning, and an ASP.NET MVC admin portal sharing one SQL Server database.&lt;/p&gt;

&lt;p&gt;This part follows a single visitor from the moment they walk in to the moment they leave.&lt;/p&gt;

&lt;p&gt;Then I will be honest about what the system lacked, and how I would upgrade it today as a senior engineer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Reception Desk Setup
&lt;/h2&gt;

&lt;p&gt;The reception PC ran a simple WPF app with three screens.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A welcome screen&lt;/strong&gt; that opened when the PC started.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A camera preview&lt;/strong&gt; showing the live webcam feed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One visitor form&lt;/strong&gt; used for both new and returning visitors.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On the desk sat two devices.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A Logitech HD 720p autofocus webcam.&lt;/strong&gt; Its base could rotate, so the receptionist simply turned it toward the visitor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A hands-free barcode scanner on a stand,&lt;/strong&gt; the kind you see at store checkouts. No trigger to press. You just hold the card in front of it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The design goal was clear. The receptionist should spend as little time as possible on the keyboard and mouse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Hands-Free Face Capture
&lt;/h2&gt;

&lt;p&gt;The receptionist asks the visitor to look at the webcam.&lt;/p&gt;

&lt;p&gt;On the preview, a blue or green box appears around the visitor's face, with a line across the eyes. If the face is turned or too far away, the receptionist asks the visitor to adjust.&lt;/p&gt;

&lt;p&gt;Then the important part. &lt;strong&gt;Nobody presses a button.&lt;/strong&gt; As soon as the camera detects a proper face, the picture is taken automatically.&lt;/p&gt;

&lt;p&gt;The Neurotechnology library extracts the face features it needs for matching. Our code then searches the database for a stored visitor with a matching face.&lt;/p&gt;

&lt;p&gt;While the camera was working, its small activity light glowed, so everyone could see a scan was in progress.&lt;/p&gt;

&lt;p&gt;The receptionist only turns the camera toward the visitor. No clicks, no typing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: A Returning Visitor
&lt;/h2&gt;

&lt;p&gt;If the face matches, the visitor's details load right away.&lt;/p&gt;

&lt;p&gt;The receptionist does only two things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Selects the host the visitor came to meet.&lt;/li&gt;
&lt;li&gt;Saves the visit.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The visitor then hands over their national ID card, which stays at reception as part of the building's standard procedure. In return, they get a visitor card to wear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: A New Visitor
&lt;/h2&gt;

&lt;p&gt;If there is no match, the receptionist fills in the form.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Types the visitor's name.&lt;/li&gt;
&lt;li&gt;Clicks into the ID number box.&lt;/li&gt;
&lt;li&gt;Holds the ID card in front of the scanner to read its barcode or QR code, or types the number by hand.&lt;/li&gt;
&lt;li&gt;Selects the host and saves.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When the card is scanned, the scanner returns more than just the ID number. Our function runs the regex from part 1 on the full scan, keeps only the ID number, and shows it in the text box.&lt;/p&gt;

&lt;p&gt;Keeping manual typing as an option was a small but useful decision. A worn barcode should never stop a check-in.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Check-Out With the Same Face
&lt;/h2&gt;

&lt;p&gt;When the visit ends, the visitor comes back to reception. They return the visitor card and collect their ID card.&lt;/p&gt;

&lt;p&gt;Before leaving, they look into the camera one more time. The system recognizes them, finds their open visit, marks them as left, and calculates the visit duration from the check-in and check-out times.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1u7res9tqv2jfnz50cii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1u7res9tqv2jfnz50cii.png" alt="Visitor lifecycle: the visitor arrives and looks at the camera, checks in with a host and gets a visitor card, has the visit, then returns the card, collects their ID card, looks at the camera again, and the system saves the visit duration" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The same face scan decides whether someone is arriving or leaving. Here is the idea in a simplified form.&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;visitor&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;faceService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FindMatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;capturedFace&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;visitor&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Unknown face: this is a new visitor&lt;/span&gt;
    &lt;span class="nf"&gt;StartNewVisitorRegistration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;capturedFace&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;openVisit&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;visitRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;GetOpenVisit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;visitor&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="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;openVisit&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Visitor already checked in: they are leaving&lt;/span&gt;
    &lt;span class="n"&gt;openVisit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckOutTime&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;DateTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;openVisit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Duration&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;openVisit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckOutTime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="n"&gt;openVisit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckInTime&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;visitRepository&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;openVisit&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Known visitor with no open visit: they are arriving&lt;/span&gt;
    &lt;span class="nf"&gt;StartRepeatVisit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;visitor&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;One camera, one face scan, two different meanings. The open visit record tells the system which one it is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Admin Side
&lt;/h2&gt;

&lt;p&gt;The admin portal was where the gaps showed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;A single fixed admin login.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One visit report&lt;/strong&gt; showing the visitor's details, the host, check-in time, check-out time, and duration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A basic date filter,&lt;/strong&gt; as far as I remember.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A search box that only searched data already loaded in the browser.&lt;/strong&gt; It never sent a search to the server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pagination with a fixed page size.&lt;/strong&gt; There was no option to change the number of rows per page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Honestly, it was basic. It did its job, but it was never polished. I was handling several projects at the same time, so the admin side never got the attention it deserved.&lt;/p&gt;

&lt;p&gt;Here is what I would build today.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Would Upgrade It Today
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Sync Hosts From the ERP
&lt;/h3&gt;

&lt;p&gt;In part 1, I mentioned that the host list had to be updated by hand.&lt;/p&gt;

&lt;p&gt;The fix is to pull hosts from the ERP automatically, with their &lt;strong&gt;department, job title, and photo&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This also solves a quieter problem. When two employees share the same name, a photo alone is not enough. With department and title, the receptionist can be sure they picked the right person.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Search Hosts by Department and Title in WPF
&lt;/h3&gt;

&lt;p&gt;Once that data exists, the WPF host picker should use it. The receptionist types a few letters, filters by department, and finds the exact person in seconds.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. A Proper Report
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Server-side search and filters.&lt;/strong&gt; Searching only loaded data works with a few hundred rows. As visits grow into the thousands, sending everything to the browser gets slow. The database should do the filtering.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Report settings,&lt;/strong&gt; like choosing which columns to show and how many rows per page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Export to Excel and PDF,&lt;/strong&gt; because managers always ask for a file.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  4. A Live Dashboard
&lt;/h3&gt;

&lt;p&gt;At a glance, the admin should see today's numbers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Total visits today.&lt;/li&gt;
&lt;li&gt;Visits in progress.&lt;/li&gt;
&lt;li&gt;Completed visits.&lt;/li&gt;
&lt;li&gt;The host with the most visitors today.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a simplified SQL Server version, using an example schema.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;DECLARE&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;Today&lt;/span&gt; &lt;span class="nb"&gt;date&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;CAST&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;GETDATE&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;date&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- Today's totals&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt;
    &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;TotalVisits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt; &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;CheckOutTime&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;InProgress&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="k"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt; &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;CheckOutTime&lt;/span&gt; &lt;span class="k"&gt;IS&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="k"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;Completed&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Visits&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;CheckInTime&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;Today&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;CheckInTime&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;DATEADD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DAY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;Today&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;-- Busiest host today&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;TOP&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HostId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FullName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;VisitCount&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;Visits&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;
&lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;Hosts&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HostId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HostId&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckInTime&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;Today&lt;/span&gt;
  &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CheckInTime&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;DATEADD&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DAY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;Today&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;HostId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FullName&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;VisitCount&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two small details matter here.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The date filter is a range,&lt;/strong&gt; not &lt;code&gt;CAST(CheckInTime AS date) = @Today&lt;/code&gt;. Wrapping the column in a function can stop SQL Server from using an index on it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The busiest host query groups by &lt;code&gt;HostId&lt;/code&gt;,&lt;/strong&gt; not only by name. Two employees with the same name would otherwise be counted as one person. It is the same problem the ERP sync solves at the front desk.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  5. Close Forgotten Check-Outs
&lt;/h3&gt;

&lt;p&gt;Some visitors will leave without checking out. Their visits stay "in progress" forever and break the dashboard numbers.&lt;/p&gt;

&lt;p&gt;A scheduled job at the end of each day can flag those visits for the admin to review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before and After
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Area&lt;/th&gt;
&lt;th&gt;What it had&lt;/th&gt;
&lt;th&gt;What I would build&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Hosts&lt;/td&gt;
&lt;td&gt;Typed in by hand&lt;/td&gt;
&lt;td&gt;Synced from the ERP with department, title, and photo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host picker&lt;/td&gt;
&lt;td&gt;Names only&lt;/td&gt;
&lt;td&gt;Search and filter by department and title&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Report search&lt;/td&gt;
&lt;td&gt;Browser only&lt;/td&gt;
&lt;td&gt;Server-side search and filters&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Report settings&lt;/td&gt;
&lt;td&gt;Fixed&lt;/td&gt;
&lt;td&gt;Columns, page size, Excel and PDF export&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Overview&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;Live dashboard for today&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Open visits&lt;/td&gt;
&lt;td&gt;Stayed open&lt;/td&gt;
&lt;td&gt;Daily check for forgotten check-outs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Hands-free capture made check-in fast. The best interface is sometimes no interface.&lt;/li&gt;
&lt;li&gt;One face scan handled both arrival and departure. The data decided the meaning, not an extra button.&lt;/li&gt;
&lt;li&gt;Manual input should stay available as a fallback.&lt;/li&gt;
&lt;li&gt;Browser-only search is fine for small data. Real reports need the database to do the work.&lt;/li&gt;
&lt;li&gt;Data that exists in another system, like employees, should be synced, not retyped.&lt;/li&gt;
&lt;li&gt;A system can work and still not be finished. Knowing the difference is part of growing as an engineer.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Over to You
&lt;/h2&gt;

&lt;p&gt;If you inherited a basic admin report like this one, what would you add first: filters, exports, or a dashboard? Tell me in the comments.&lt;/p&gt;

&lt;p&gt;This is the final part of the series. If you missed it, &lt;a href="https://dev.to/umerfarooqofficial/i-took-over-a-net-visitor-system-with-face-recognition-5bnc"&gt;part 1&lt;/a&gt; covers the architecture, the ID card regex, and the Windows Update problem.&lt;/p&gt;

&lt;p&gt;If you are working on a similar system, or you are hiring a .NET developer who enjoys this kind of work, you can reach me through &lt;a href="https://umerfarooqofficial.com/" rel="noopener noreferrer"&gt;my website&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>sql</category>
      <category>architecture</category>
    </item>
    <item>
      <title>I Took Over a .NET Visitor System with Face Recognition</title>
      <dc:creator>Umer Farooq</dc:creator>
      <pubDate>Fri, 30 Oct 2026 10:44:47 +0000</pubDate>
      <link>https://dev.to/umerfarooqofficial/i-took-over-a-net-visitor-system-with-face-recognition-5bnc</link>
      <guid>https://dev.to/umerfarooqofficial/i-took-over-a-net-visitor-system-with-face-recognition-5bnc</guid>
      <description>&lt;p&gt;A visitor walks up to the reception desk. They look at the webcam for a moment.&lt;/p&gt;

&lt;p&gt;Before they say a word, the system already knows if they have been here before.&lt;/p&gt;

&lt;p&gt;If they are new, the receptionist scans their national ID card. The ID number fills itself in. No typing. No typos.&lt;/p&gt;

&lt;p&gt;I did not build this system from scratch. Around 2018, it was handed over to me. From then on, I was solely responsible for its enhancements, modifications, bug fixes, and new features.&lt;/p&gt;

&lt;p&gt;Owning someone else's system teaches you things that building your own never does. In this post, I will walk you through how it worked, the two problems that taught me the most, and what I would change if I built it today.&lt;/p&gt;

&lt;p&gt;This is part 1 of a two-part series. Part 2 follows a visitor from check-in to check-out and covers the admin side.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem It Solved
&lt;/h2&gt;

&lt;p&gt;Reception desks deal with the same issues every day.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Typing ID numbers by hand.&lt;/strong&gt; National ID numbers are long. One wrong digit makes the record useless.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No memory of past visitors.&lt;/strong&gt; A returning visitor had to give the same details again and again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No clear reporting.&lt;/strong&gt; Management wanted to know who visited, when, and how often.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal was simple. Make check-in fast, accurate, and traceable.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&gt;

&lt;p&gt;The system had three main parts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;WPF reception app.&lt;/strong&gt; It ran on the reception PC, with a webcam and a desktop barcode scanner attached. The scanner was the same kind stores use to scan products.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ASP.NET MVC admin portal.&lt;/strong&gt; Administrators used it to view daily and monthly visitor reports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One shared SQL Server database.&lt;/strong&gt; Both apps read and wrote to the same database. There was no API layer between them.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff4q3bsxg83r0fk82umdz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff4q3bsxg83r0fk82umdz.png" alt="Architecture diagram: at the reception desk, a webcam and an ID scanner feed a WPF desk app. In the admin office, an admin uses a web admin portal. Both apps connect to one shared SQL Server database." width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both apps were built on .NET Framework 4.7.&lt;/p&gt;

&lt;p&gt;Why a shared database? I did not make that choice, but I understand it. Both apps needed the same data, and a shared database is the fastest way to ship. I will come back to this design later, because today I would do it differently.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Visitor Flow
&lt;/h2&gt;

&lt;p&gt;Here is what happened at the desk, step by step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzgwfdv9f6m0z275edp11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzgwfdv9f6m0z275edp11.png" alt="Check-in flow: the visitor looks at the webcam, the app checks for a face match, returning visitors load saved details, new visitors give details and scan their ID card, then the host is selected, the visit is saved, and it appears in admin reports" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The visitor looks at the webcam.&lt;/li&gt;
&lt;li&gt;The app captures the face and checks it against stored visitors using the Neurotechnology face recognition SDK.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Returning visitor:&lt;/strong&gt; their details load right away. The receptionist confirms the visit and selects the host.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;New visitor:&lt;/strong&gt; the receptionist asks for their details and their national ID card.&lt;/li&gt;
&lt;li&gt;The receptionist scans the barcode or QR code on the ID card. The ID number fills in automatically.&lt;/li&gt;
&lt;li&gt;The visit is saved to the database. It then shows up in the admin portal reports.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is the decision logic in a simplified form. The real code had more validation, but the idea is the same.&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;match&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;faceService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;FindMatch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;capturedFace&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Returning visitor: load saved details&lt;/span&gt;
    &lt;span class="nf"&gt;ShowReturningVisitor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;VisitorId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// New visitor: start registration and keep the face template&lt;/span&gt;
    &lt;span class="nf"&gt;StartNewVisitorRegistration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;capturedFace&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;h2&gt;
  
  
  Scanning the ID Card
&lt;/h2&gt;

&lt;p&gt;Every citizen has a unique numeric national ID number. Many ID cards carry it in a barcode, and some carry it in a QR code.&lt;/p&gt;

&lt;p&gt;The catch is that the code holds more than the ID number. A scan returns extra details along with it. The app needed only the ID number.&lt;/p&gt;

&lt;p&gt;So I used a regular expression to pull out just the part I needed.&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;using&lt;/span&gt; &lt;span class="nn"&gt;System.Text.RegularExpressions&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;IdCardParser&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Example: a 13 digit ID number.&lt;/span&gt;
    &lt;span class="c1"&gt;// Adjust the length to match your country's ID format.&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="n"&gt;Regex&lt;/span&gt; &lt;span class="n"&gt;IdPattern&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;
        &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;Regex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;@"(?&amp;lt;!\d)\d{13}(?!\d)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;RegexOptions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Compiled&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="nf"&gt;ExtractNationalId&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;scannedText&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;IsNullOrWhiteSpace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scannedText&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="n"&gt;Match&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;IdPattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scannedText&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Success&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Value&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;null&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;The lookarounds &lt;code&gt;(?&amp;lt;!\d)&lt;/code&gt; and &lt;code&gt;(?!\d)&lt;/code&gt; matter. They make sure we match exactly 13 digits, not 13 digits taken from the middle of a longer number.&lt;/p&gt;

&lt;p&gt;This one small step removed manual typing at the desk. It also removed the typing errors that came with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two Problems That Taught Me the Most
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. A Windows Update Could Break Face Recognition
&lt;/h3&gt;

&lt;p&gt;This was the hardest technical issue.&lt;/p&gt;

&lt;p&gt;The Neurotechnology libraries needed a specific .NET Framework version. If Windows Update installed a newer .NET Framework version on the reception PC, face scanning and matching stopped working.&lt;/p&gt;

&lt;p&gt;Our fix during implementation was to keep Windows Updates turned off on the reception PCs.&lt;/p&gt;

&lt;p&gt;It worked. But it was a trade-off. A PC without updates also misses security patches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; when your app depends on a third party SDK, the runtime version is part of your system. Plan for it from day one.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The Host List Lived in Its Own Island
&lt;/h3&gt;

&lt;p&gt;Every visitor comes to meet someone. That person is the host.&lt;/p&gt;

&lt;p&gt;The system had no integration with the company's ERP. So when an employee joined or left, the VMS administrator had to update the host list by hand.&lt;/p&gt;

&lt;p&gt;That works on day one. Over time, it means outdated hosts, missing new joiners, and extra admin work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson:&lt;/strong&gt; any list of people that already exists somewhere else should be synced, not copied by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Would Do Differently Today
&lt;/h2&gt;

&lt;p&gt;Looking back, the system did its job. But my thinking has grown since then. Here is what I would change.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add an API layer.&lt;/strong&gt; Instead of two apps sharing one database, the admin portal and the desk app would talk through an ASP.NET Core Web API. That gives one place for business rules and security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Control the runtime, not the whole OS.&lt;/strong&gt; Modern .NET supports self contained deployment, so the app ships with its own runtime. Operating system updates could then install without changing the version the app depends on. This assumes the SDK supports modern .NET, which I would confirm first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manage updates instead of blocking them.&lt;/strong&gt; If the runtime must stay fixed, I would hold back specific updates through group policy and test them on a staging PC first, rather than turning off all updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sync hosts automatically.&lt;/strong&gt; A scheduled import or an API from the ERP or HR system would keep the host list current with no manual work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat face data as sensitive from the start.&lt;/strong&gt; I would make clear retention and consent rules a day one requirement, not an afterthought.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Small automations, like scanning an ID instead of typing it, remove a whole class of errors.&lt;/li&gt;
&lt;li&gt;Third party SDKs bring hidden constraints. Know them before deployment.&lt;/li&gt;
&lt;li&gt;A shared database is fast to start with, but an API layer scales better.&lt;/li&gt;
&lt;li&gt;Data that already exists in another system should be integrated, not retyped.&lt;/li&gt;
&lt;li&gt;Inheriting a system is a fast way to learn. You see decisions you would not make yourself, and you learn why they were made.&lt;/li&gt;
&lt;li&gt;Looking back at old projects honestly is one of the best ways to grow.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Over to You
&lt;/h2&gt;

&lt;p&gt;Have you ever had a Windows or framework update break a hardware or SDK integration? How did you handle it? Tell me in the comments.&lt;/p&gt;

&lt;p&gt;In part 2, I will follow a visitor from check-in to check-out, and share how I would upgrade the admin side today. Follow me so you do not miss it.&lt;/p&gt;

&lt;p&gt;If you are working on a similar system, or you are hiring a .NET developer who enjoys this kind of work, you can reach me through &lt;a href="https://umerfarooqofficial.com/" rel="noopener noreferrer"&gt;my website&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>csharp</category>
      <category>dotnet</category>
      <category>architecture</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Learn .NET in 2026 (Without Getting Lost)</title>
      <dc:creator>Umer Farooq</dc:creator>
      <pubDate>Mon, 02 Feb 2026 19:11:16 +0000</pubDate>
      <link>https://dev.to/umerfarooqofficial/how-to-learn-net-in-2026-without-getting-lost-1ekk</link>
      <guid>https://dev.to/umerfarooqofficial/how-to-learn-net-in-2026-without-getting-lost-1ekk</guid>
      <description>&lt;p&gt;Learning .NET in 2026 is very different from how it was a few years ago.&lt;/p&gt;

&lt;p&gt;The platform has grown massively.&lt;br&gt;
So has the confusion.&lt;/p&gt;

&lt;p&gt;If you are new to .NET, or even coming back after a break, you will quickly run into questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Should I start with ASP.NET Core or APIs?&lt;/li&gt;
&lt;li&gt;Do I need Blazor now?&lt;/li&gt;
&lt;li&gt;Which .NET version actually matters?&lt;/li&gt;
&lt;li&gt;How much C# should I know before touching frameworks?&lt;/li&gt;
&lt;li&gt;When do things like Docker, Azure, or DevOps come into play?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most people don’t struggle because .NET is hard.&lt;br&gt;
They struggle because they &lt;strong&gt;don’t know what to learn next.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The real problem is not learning, it’s direction
&lt;/h2&gt;

&lt;p&gt;Today, learning .NET usually looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jumping between random tutorials&lt;/li&gt;
&lt;li&gt;Watching outdated videos&lt;/li&gt;
&lt;li&gt;Mixing beginner and advanced topics too early&lt;/li&gt;
&lt;li&gt;Copy-pasting code without understanding fundamentals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This leads to burnout, not progress.&lt;/p&gt;

&lt;p&gt;Many beginners quit thinking “.NET is too big.”&lt;br&gt;
When in reality, &lt;strong&gt;they didn’t have a clear path.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Common mistakes I see beginners make
&lt;/h2&gt;

&lt;p&gt;After years of experience and mentoring developers, these mistakes show up again and again:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Skipping fundamentals like OOP, C#, and debugging&lt;/li&gt;
&lt;li&gt;Jumping straight into frameworks without understanding the runtime&lt;/li&gt;
&lt;li&gt;Learning tools before concepts&lt;/li&gt;
&lt;li&gt;Trying to learn everything at once&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without structure, even the most skilled developers can get stuck.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a structured roadmap actually solves
&lt;/h2&gt;

&lt;p&gt;A good roadmap does not teach you everything.&lt;/p&gt;

&lt;p&gt;It tells you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;What to learn first&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What to ignore for now&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When to go deeper&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How topics connect&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of guessing, you follow a sequence that builds confidence step by step.&lt;/p&gt;

&lt;p&gt;That’s the difference between consuming content and making progress.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical .NET roadmap for 2026
&lt;/h2&gt;

&lt;p&gt;To solve this problem, I created a complete, step-by-step .NET roadmap based on real-world experience, not trends.&lt;/p&gt;

&lt;p&gt;It covers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Core fundamentals before frameworks&lt;/li&gt;
&lt;li&gt;Web and API tracks&lt;/li&gt;
&lt;li&gt;Data access and EF Core&lt;/li&gt;
&lt;li&gt;Cloud and DevOps at the right stage&lt;/li&gt;
&lt;li&gt;Advanced architecture and performance topics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most importantly, it explains why each stage matters and when you should move forward.&lt;/p&gt;

&lt;p&gt;You can explore the roadmap here:&lt;br&gt;
👉 &lt;a href="https://umerfarooqofficial.com/dotnet-roadmap" rel="noopener noreferrer"&gt;https://umerfarooqofficial.com/dotnet-roadmap&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(One path. No noise.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;You don’t need to rush.&lt;br&gt;
You don’t need to learn everything.&lt;/p&gt;

&lt;p&gt;You need a clear direction.&lt;/p&gt;

&lt;p&gt;If you are serious about learning .NET in 2026, focus on fundamentals, follow a structured path, and let depth come naturally.&lt;/p&gt;

&lt;p&gt;Progress comes from clarity, not speed.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>career</category>
      <category>learning</category>
    </item>
    <item>
      <title>10 Real World Use Cases of SignalR Every .NET Developer Should Know</title>
      <dc:creator>Umer Farooq</dc:creator>
      <pubDate>Wed, 21 Jan 2026 09:18:53 +0000</pubDate>
      <link>https://dev.to/umerfarooqofficial/10-real-world-use-cases-of-signalr-every-net-developer-should-know-2g20</link>
      <guid>https://dev.to/umerfarooqofficial/10-real-world-use-cases-of-signalr-every-net-developer-should-know-2g20</guid>
      <description>&lt;p&gt;Real-time applications are no longer optional. Modern users expect instant updates, live interactions, and zero delay. SignalR enables &lt;strong&gt;bi-directional, low-latency communication&lt;/strong&gt; between the server and connected clients in .NET applications.&lt;/p&gt;

&lt;p&gt;Whether you are building dashboards, finance systems, ecommerce apps, AI-assisted workflows, or enterprise solutions, SignalR unlocks capabilities that make your application feel modern, responsive, and intelligent.&lt;/p&gt;

&lt;p&gt;Here are &lt;strong&gt;ten real-world use cases&lt;/strong&gt; that show why SignalR is one of the most powerful technologies in the .NET ecosystem today.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Real-Time Dashboards for Monitoring and Analytics
&lt;/h2&gt;

&lt;p&gt;Companies rely on dashboards for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server health&lt;/li&gt;
&lt;li&gt;CPU and memory load&lt;/li&gt;
&lt;li&gt;Application logs&lt;/li&gt;
&lt;li&gt;Database performance&lt;/li&gt;
&lt;li&gt;Order volumes&lt;/li&gt;
&lt;li&gt;Business KPIs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With SignalR, dashboards can push updates the moment data changes.&lt;br&gt;
No refresh, no polling, no delay.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modern examples include:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud infrastructure dashboards&lt;/li&gt;
&lt;li&gt;Financial transaction dashboards&lt;/li&gt;
&lt;li&gt;IoT monitoring boards&lt;/li&gt;
&lt;li&gt;DevOps observability tools&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb95t6sqfr01jrtg9pb0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb95t6sqfr01jrtg9pb0z.png" alt="Live chart updating with new metrics" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Live Notifications and Alerts
&lt;/h2&gt;

&lt;p&gt;Users expect instant alerts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;New message&lt;/li&gt;
&lt;li&gt;Task assigned&lt;/li&gt;
&lt;li&gt;Report generated&lt;/li&gt;
&lt;li&gt;Status updated&lt;/li&gt;
&lt;li&gt;Payment processed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SignalR pushes notifications immediately to web or desktop clients.&lt;br&gt;
This is much faster and more reliable than refresh-based checks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modern examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project management tools&lt;/li&gt;
&lt;li&gt;Collaboration platforms&lt;/li&gt;
&lt;li&gt;Helpdesk ticketing systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuf67us45osn440tf7h8s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuf67us45osn440tf7h8s.png" alt="Live Notifications in a digital world" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Real-Time Collaboration Tools
&lt;/h2&gt;

&lt;p&gt;Collaboration apps depend on simultaneous editing.&lt;/p&gt;

&lt;p&gt;SignalR helps build features like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live document editing&lt;/li&gt;
&lt;li&gt;Shared code editors&lt;/li&gt;
&lt;li&gt;Whiteboard updates&lt;/li&gt;
&lt;li&gt;Multiple cursors on the same screen&lt;/li&gt;
&lt;li&gt;Real-time comment threads&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Real-world inspiration:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Google Docs, Figma, VS Code Live Share.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8s3donvdlymj57ytzbe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq8s3donvdlymj57ytzbe.png" alt="Multiple cursors editing a document" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Chat, Messaging, and Communication Systems
&lt;/h2&gt;

&lt;p&gt;Chat remains one of the most common uses.&lt;/p&gt;

&lt;p&gt;SignalR supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Group chats&lt;/li&gt;
&lt;li&gt;Typing indicators&lt;/li&gt;
&lt;li&gt;Read receipts&lt;/li&gt;
&lt;li&gt;User online status&lt;/li&gt;
&lt;li&gt;Delivery confirmations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This works for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer support chat&lt;/li&gt;
&lt;li&gt;Live operator chat&lt;/li&gt;
&lt;li&gt;Internal team chat&lt;/li&gt;
&lt;li&gt;Broadcast messaging&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Live Order Tracking and Delivery Updates
&lt;/h2&gt;

&lt;p&gt;SignalR is a perfect fit for e-commerce and logistics.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Food delivery progress&lt;/li&gt;
&lt;li&gt;Courier package tracking&lt;/li&gt;
&lt;li&gt;Rider location updates&lt;/li&gt;
&lt;li&gt;Order dispatching&lt;/li&gt;
&lt;li&gt;Real-time ETA calculations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Users love seeing live numbers move.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fazuzbuiu8aaplo8g77lk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fazuzbuiu8aaplo8g77lk.png" alt="Live delivery tracking map" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Real-Time Financial and Trading Apps
&lt;/h2&gt;

&lt;p&gt;Finance is a sector where &lt;strong&gt;delay is unacceptable.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SignalR helps with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Live stock tickers&lt;/li&gt;
&lt;li&gt;Forex rate changes&lt;/li&gt;
&lt;li&gt;Crypto market updates&lt;/li&gt;
&lt;li&gt;Portfolio changes&lt;/li&gt;
&lt;li&gt;Buy or sell events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Financial dashboards rely heavily on SignalR style streaming.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Multiplayer Games and Game State Synchronization
&lt;/h2&gt;

&lt;p&gt;Games need millisecond communication.&lt;/p&gt;

&lt;p&gt;SignalR supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Player positions&lt;/li&gt;
&lt;li&gt;Game state updates&lt;/li&gt;
&lt;li&gt;Leaderboards&lt;/li&gt;
&lt;li&gt;Matchmaking&lt;/li&gt;
&lt;li&gt;Real-time scores&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many casual browser games use SignalR for fast interactions.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. IoT and Hardware Event Streaming
&lt;/h2&gt;

&lt;p&gt;Modern IoT systems generate events continuously.&lt;/p&gt;

&lt;p&gt;SignalR can push:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sensor data&lt;/li&gt;
&lt;li&gt;Device status&lt;/li&gt;
&lt;li&gt;Temperature changes&lt;/li&gt;
&lt;li&gt;RFID scans&lt;/li&gt;
&lt;li&gt;Motion detection&lt;/li&gt;
&lt;li&gt;Machine health&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is used in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Smart factories&lt;/li&gt;
&lt;li&gt;Warehouses&lt;/li&gt;
&lt;li&gt;Home automation&lt;/li&gt;
&lt;li&gt;Industrial systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjpjq8nvgzfocg48cneis.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjpjq8nvgzfocg48cneis.png" alt="IoT event streaming and data flow" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Workflow Systems and Queue Processing
&lt;/h2&gt;

&lt;p&gt;In enterprises, workflow automation is everywhere:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Approvals&lt;/li&gt;
&lt;li&gt;Tasks&lt;/li&gt;
&lt;li&gt;Document routing&lt;/li&gt;
&lt;li&gt;Reviews&lt;/li&gt;
&lt;li&gt;Ticket resolution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SignalR supports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Updating task stages&lt;/li&gt;
&lt;li&gt;Showing real-time progress&lt;/li&gt;
&lt;li&gt;Live status updates&lt;/li&gt;
&lt;li&gt;Workflow transitions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This removes friction from company operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. Live Event Broadcasting and Sports Updates
&lt;/h2&gt;

&lt;p&gt;Live events attract high traffic and need instant updates.&lt;/p&gt;

&lt;p&gt;SignalR enables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Score updates&lt;/li&gt;
&lt;li&gt;Match highlights&lt;/li&gt;
&lt;li&gt;Fan vote results&lt;/li&gt;
&lt;li&gt;Leaderboards&lt;/li&gt;
&lt;li&gt;Event countdowns&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From sports apps to live stream dashboards, this pattern is used everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;SignalR is more than a library; it is a foundation for building modern real-time experiences. Whether you are working on fintech, ecommerce, collaboration tools, dashboards, gaming, IoT systems, or enterprise workflows, SignalR helps your application behave like a modern app that responds instantly.&lt;/p&gt;

&lt;p&gt;If you are a .NET developer who has not used SignalR yet, the best way to learn is to pick one simple feature from this list and build it. Once you see real-time updates in action, you will realize how powerful and enjoyable it is.&lt;/p&gt;

&lt;p&gt;If you are curious about how I apply these patterns in real projects, including dashboards, real-time monitoring, and communication systems, you can explore my work here: &lt;a href="https://umerfarooqofficial.com/" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>dotnet</category>
      <category>signalr</category>
    </item>
    <item>
      <title>How I Built a Real-Time Dashboard in .NET to Catch Bugs Before Users Did</title>
      <dc:creator>Umer Farooq</dc:creator>
      <pubDate>Mon, 13 Oct 2025 13:50:11 +0000</pubDate>
      <link>https://dev.to/umerfarooqofficial/how-i-built-a-real-time-dashboard-in-net-to-catch-bugs-before-users-did-1bc9</link>
      <guid>https://dev.to/umerfarooqofficial/how-i-built-a-real-time-dashboard-in-net-to-catch-bugs-before-users-did-1bc9</guid>
      <description>&lt;p&gt;As developers, we often hear the phrase "users are the best testers." I used to believe that too, until one day a client found a serious bug before we did. It was embarrassing. That incident taught me a valuable lesson: &lt;strong&gt;never rely on users to tell you when something is broken&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So I decided to build a &lt;strong&gt;real-time monitoring dashboard&lt;/strong&gt; in .NET to catch bugs and issues as they happened. In this post, I'll walk you through how I designed it, what I learned, and why it became one of the most useful tools I've ever built.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Problem
&lt;/h2&gt;

&lt;p&gt;Before this dashboard, our workflow looked something like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A bug appeared on the production server.&lt;/li&gt;
&lt;li&gt;The user reported it.&lt;/li&gt;
&lt;li&gt;The QA team recreated the issue.&lt;/li&gt;
&lt;li&gt;Then the developers investigated and fixed it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxjws2rrmlo3cmc60rwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxjws2rrmlo3cmc60rwl.png" alt="Old Process VS New Process" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By the time we found the cause, hours had already been wasted, and sometimes customer trust, too.&lt;/p&gt;

&lt;p&gt;I wanted to change that. I wanted a system that would alert us before users even noticed something wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Idea: A Real-Time Monitoring Dashboard
&lt;/h2&gt;

&lt;p&gt;The concept was simple. I wanted a dashboard that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Captured logs in real-time.&lt;/li&gt;
&lt;li&gt;Displayed error frequency visually.&lt;/li&gt;
&lt;li&gt;Highlighted anomalies and performance drops.&lt;/li&gt;
&lt;li&gt;Sent alerts for critical errors automatically.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;I call it Developer Dashboard.&lt;/strong&gt; It became my personal way to monitor logs, bugs, and performance in one place.&lt;/p&gt;

&lt;p&gt;I chose ASP.NET Core for the backend and SignalR for real-time updates. For the frontend, I used a lightweight charting library to visualize data instantly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5zuexg8dqhxz50fpwk4a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5zuexg8dqhxz50fpwk4a.png" alt="Real-Time Developer Dashboard" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. How I Built It
&lt;/h2&gt;

&lt;p&gt;Here's a simplified version of how the system works behind the scenes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application Logs:&lt;/strong&gt;&lt;br&gt;
Every error or warning in the system is logged into a centralized log database using Serilog with a SQL Server sink.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SignalR Hub:&lt;/strong&gt;&lt;br&gt;
A SignalR hub broadcasts the latest log entries to connected dashboard clients in real time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dashboard UI:&lt;/strong&gt;&lt;br&gt;
The front-end dashboard connects to the hub and updates charts or tables whenever a new log appears.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Alerts System:&lt;/strong&gt;&lt;br&gt;
When a critical log is detected (like an exception in a payment module), an email or Twilio SMS alert is triggered immediately.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4job8xc6jg4gaplgm7ul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4job8xc6jg4gaplgm7ul.png" alt="Architecture" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  4. The Real Magic: SignalR
&lt;/h2&gt;

&lt;p&gt;SignalR was the key that made it all come alive.&lt;br&gt;
Whenever a new log was inserted, the SignalR hub broadcast the event instantly to all connected clients. This made the dashboard feel &lt;strong&gt;alive&lt;/strong&gt; and &lt;strong&gt;immediate&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class LogHub : Hub
{
    public async Task SendLogUpdate(LogEntry log)
    {
        await Clients.All.SendAsync("ReceiveLog", log);
    }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;connection.on("ReceiveLog", (log) =&amp;gt; {
    addLogToTable(log);
    updateCharts();
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It was smooth, fast, and surprisingly simple to implement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5337n0k0rka9g6hmo2eb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5337n0k0rka9g6hmo2eb.png" alt="SignalR Logs" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. What I Learned
&lt;/h2&gt;

&lt;p&gt;Building this taught me several lessons that go beyond code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Monitoring saves time, and catching issues early means less damage later.&lt;/li&gt;
&lt;li&gt;Real-time feedback changes developer behavior. When you see errors live, you fix them faster.&lt;/li&gt;
&lt;li&gt;Visibility builds confidence; both developers and clients trust the system more.&lt;/li&gt;
&lt;li&gt;Small tools can make big cultural impacts; they improved how our team worked every day.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatbqrmwbtymtt079i9ug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fatbqrmwbtymtt079i9ug.png" alt="Developers Collaborating" width="800" height="659"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. How You Can Build One Too
&lt;/h2&gt;

&lt;p&gt;If you want to build something similar, start small:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use Serilog with a file or database sink.&lt;/li&gt;
&lt;li&gt;Add SignalR for real-time updates.&lt;/li&gt;
&lt;li&gt;Build a simple web page that displays incoming logs.&lt;/li&gt;
&lt;li&gt;Later, enhance it with charts, filters, and Twilio alerts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Even a minimal setup can save you hours of debugging later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This real-time dashboard started as an experiment, but it became an essential part of every project I built afterward. It didn't just help me find bugs faster, &lt;strong&gt;it changed the way I approached reliability&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If you're a .NET developer who wants to build resilient systems, don't wait for the next bug report to remind you. Start monitoring before your users do. You’ll thank yourself later.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>dotnet</category>
      <category>career</category>
      <category>programming</category>
    </item>
    <item>
      <title>10 Things I Learned in 9 Years as a .NET Developer</title>
      <dc:creator>Umer Farooq</dc:creator>
      <pubDate>Thu, 02 Oct 2025 11:39:46 +0000</pubDate>
      <link>https://dev.to/umerfarooqofficial/10-things-i-learned-in-9-years-as-a-net-developer-52mc</link>
      <guid>https://dev.to/umerfarooqofficial/10-things-i-learned-in-9-years-as-a-net-developer-52mc</guid>
      <description>&lt;p&gt;When I started my career as a .NET developer, I didn't know that the little habits I picked up along the way would make such a big difference. Things like documenting my work thoroughly, improving UI even if it wasn't my primary task, or experimenting with hardware integrations just to see &lt;em&gt;what if&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Now, after years of working on projects ranging from enterprise apps to real-time monitoring dashboards, I've realized these are exactly the things that helped me stand out.&lt;/p&gt;

&lt;p&gt;If you're just starting your career as a developer (maybe fresh out of university or about to step into freelancing), I want to share some of these lessons with you. Hopefully, you'll pick something up that can save you a few extra nights of debugging.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Documentation Is Your Secret Weapon
&lt;/h2&gt;

&lt;p&gt;One of the most underrated skills in tech is &lt;strong&gt;writing things down.&lt;/strong&gt;&lt;br&gt;
Whether it's &lt;strong&gt;API usage, integration steps&lt;/strong&gt;, or even a &lt;strong&gt;weird bug&lt;/strong&gt; you fixed, documenting it will save you and your team in the future.&lt;/p&gt;

&lt;p&gt;I make it a habit to &lt;strong&gt;document every solution I build&lt;/strong&gt;. It's not just for others, because half the time I end up reading my own notes months later. That’s also how I started building &lt;strong&gt;developer dashboards&lt;/strong&gt; inside my apps, to monitor &lt;strong&gt;real-time bugs, log issues&lt;/strong&gt;, and keep everything transparent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89a833qm9nifpbh9in7c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F89a833qm9nifpbh9in7c.png" alt="Clean Code" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Building Beyond the Basics
&lt;/h2&gt;

&lt;p&gt;Sure, delivering what's asked is important. But the real fun (and growth) starts when you &lt;strong&gt;add something extra.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In my case, that often meant experimenting with things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Twilio integrations (sending real-time SMS/alerts).&lt;/li&gt;
&lt;li&gt;Hardware + software combinations.&lt;/li&gt;
&lt;li&gt;Improving the UI even if nobody explicitly asked.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These "extras" not only made the apps better but also gave me practical experience that most developers skip. And trust me, when clients or managers see that, they notice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjjbkb7gfkxmtp7c8cieu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjjbkb7gfkxmtp7c8cieu.png" alt="Workflow" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why UI Matters (Even for Backend Developers)
&lt;/h2&gt;

&lt;p&gt;I've met many developers who think UI isn't their concern. But let me tell you this: &lt;strong&gt;users don't see your code, they see your interface&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Whenever I worked on a project, I made sure the UI wasn't just functional. It felt smooth and intuitive. Even small touches, like meaningful error messages or a simple dashboard view, created a big impact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumzv65bjsaxdg9iynneg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fumzv65bjsaxdg9iynneg.png" alt="UI: Before and After" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Developer Dashboards: My Favorite Productivity Boost
&lt;/h2&gt;

&lt;p&gt;I build a &lt;strong&gt;custom developer dashboard&lt;/strong&gt; for almost every project. Think of it as a mission control panel; you can track real-time bugs, errors, and system performance at a glance.&lt;/p&gt;

&lt;p&gt;Not only does this save hours of debugging, but it also shows professionalism when clients see you're proactive about monitoring.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsr9rho2v79hoe32lg42u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsr9rho2v79hoe32lg42u.png" alt="Developer Dashboard" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My Advice for Beginners
&lt;/h2&gt;

&lt;p&gt;If you're a junior developer or just starting your freelancing journey, here are a few takeaways from my experience:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Learn to document, your future self will thank you.&lt;/li&gt;
&lt;li&gt;Don't be afraid to experiment beyond requirements.&lt;/li&gt;
&lt;li&gt;UI matters more than you think.&lt;/li&gt;
&lt;li&gt;Create tools (like dashboards) that make your life easier.&lt;/li&gt;
&lt;li&gt;Stay curious. Every small improvement compounds over time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; it's not just about coding, it's about solving problems and making life easier for the end user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Want to See These Lessons in Action?
&lt;/h2&gt;

&lt;p&gt;All of this isn't just theory; I've applied these ideas in real-world projects.&lt;br&gt;
If you'd like to explore them (and maybe get some inspiration for your own journey), check out my portfolio here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://umerfarooqofficial.com/" rel="noopener noreferrer"&gt;Visit my portfolio&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll find project details and examples of how I combined these practices in real applications. Who knows, it might just give you the spark for your next idea.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>webdev</category>
      <category>career</category>
    </item>
  </channel>
</rss>
