Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Author: ErcanOPAK

SQL

Avoid SELECT *

- 26.01.26 - ErcanOPAK comment on Avoid SELECT *

Why it mattersBreaks caching, increases IO, hides schema drift.

Read More
SQL

Covering Indexes Prevent Lookups

- 26.01.26 - ErcanOPAK comment on Covering Indexes Prevent Lookups

CREATE INDEX IX_User_Email ON Users (Email) INCLUDE (Name); Why it mattersFewer disk reads = faster queries.

Read More
Asp.Net Core / C#

Use MapGroup for Clean Endpoints

- 26.01.26 - ErcanOPAK comment on Use MapGroup for Clean Endpoints

app.MapGroup(“/api/users”) .MapGet(“/”, GetUsers); Why it mattersBetter structure without controllers.

Read More
Asp.Net Core / C#

Why Minimal APIs Improve Cold Start

- 26.01.26 - ErcanOPAK comment on Why Minimal APIs Improve Cold Start

app.MapGet(“/ping”, () => “pong”); Why it mattersLess middleware, faster startup.

Read More
Git

Visualize Branch History Clearly

- 26.01.26 - ErcanOPAK comment on Visualize Branch History Clearly

git log –oneline –graph –all Why it mattersInstant mental model of the repo.

Read More
Git

Stash Only What You Need

- 26.01.26 - ErcanOPAK comment on Stash Only What You Need

git stash push -m “temp” file.cs Why it mattersCleaner context switching.

Read More
Ajax / JavaScript

Send JSON the Right Way

- 26.01.26 - ErcanOPAK comment on Send JSON the Right Way

fetch(url, { method: “POST”, headers: { “Content-Type”: “application/json” }, body: JSON.stringify(data) }); Why it mattersAvoids silent model binding failures.

Read More
JavaScript

Use requestIdleCallback for Background Tasks

- 26.01.26 | 26.01.26 - ErcanOPAK comment on Use requestIdleCallback for Background Tasks

requestIdleCallback(() => heavyWork()); Why it mattersRuns tasks without blocking UI.

Read More
HTML

Native Lazy Loading Without JS

- 26.01.26 | 26.01.26 - ErcanOPAK comment on Native Lazy Loading Without JS

<img src=”img.jpg” loading=”lazy”> Why it mattersInstant speed win, zero JS.

Read More
CSS

Use clamp() for Perfect Responsive Font Sizes

- 26.01.26 - ErcanOPAK comment on Use clamp() for Perfect Responsive Font Sizes

font-size: clamp(1rem, 2vw, 1.5rem); Why it mattersOne rule replaces media queries.

Read More
Windows

Clipboard History is a Superpower

- 26.01.26 - ErcanOPAK comment on Clipboard History is a Superpower

Win + V Why it mattersMultiple snippets = faster coding and writing.

Read More
Windows

Enable Ultimate Performance Mode

- 26.01.26 - ErcanOPAK comment on Enable Ultimate Performance Mode

powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 Why it mattersNo throttling during heavy builds or renders.

Read More
AI

Emergency Home Repair Assistant

- 26.01.26 - ErcanOPAK comment on Emergency Home Repair Assistant

Prompt Act as a home maintenance expert. Give step-by-step guidance using only common household tools. Why it mattersPractical, offline-friendly, panic-proof advice.

Read More
AI

Convert Legacy Code to Modern Patterns

- 26.01.26 - ErcanOPAK comment on Convert Legacy Code to Modern Patterns

Prompt Refactor this code using modern best practices, explain why each change matters. Why it mattersYou learn why, not just what.

Read More
AI

Generate Code Reviews Like a Senior Engineer

- 26.01.26 - ErcanOPAK comment on Generate Code Reviews Like a Senior Engineer

Prompt Review this code for performance, security, and maintainability.Suggest improvements with explanations and alternative patterns. Why it mattersTurns AI into a virtual lead developer.

Read More
Docker

Multi-Stage Builds = Smaller Images, Faster Deploys

- 26.01.26 - ErcanOPAK comment on Multi-Stage Builds = Smaller Images, Faster Deploys

FROM node:18 AS build RUN npm run build FROM nginx:alpine COPY –from=build /app/dist /usr/share/nginx/html Why it mattersRemoves build junk → secure & tiny images.

Read More
Kubernetes

Why Liveness ≠ Readiness Probes

- 26.01.26 - ErcanOPAK comment on Why Liveness ≠ Readiness Probes

livenessProbe: httpGet: path: /health readinessProbe: httpGet: path: /ready Why it mattersLiveness restarts pods, readiness controls traffic. Mixing them causes outages.

Read More
Wordpress

Custom Post Status for Internal Workflows

- 26.01.26 | 26.01.26 - ErcanOPAK comment on Custom Post Status for Internal Workflows

Editorial chaos? Add your own status. register_post_status(‘internal-review’, [ ‘label’ => ‘Internal Review’, ‘public’ => false ]); Why it mattersCleaner workflows without extra plugins.

Read More
Wordpress

Disable Heartbeat API Selectively (Not Globally)

- 26.01.26 - ErcanOPAK comment on Disable Heartbeat API Selectively (Not Globally)

Heartbeat eats CPU on admin screens. add_action(‘init’, function () { wp_deregister_script(‘heartbeat’); }); Why it mattersAdmin stays responsive without breaking autosave where needed.

Read More
Photoshop

Export Web Images Without Losing Color Accuracy

- 26.01.26 - ErcanOPAK comment on Export Web Images Without Losing Color Accuracy

Browsers assume sRGB. Always:Edit → Convert to Profile → sRGB IEC61966-2.1 Why it mattersFixes “why does my image look different online?” forever.

Read More
Photoshop

Non-Destructive Sharpening with High Pass Layer

- 26.01.26 - ErcanOPAK comment on Non-Destructive Sharpening with High Pass Layer

Never sharpen directly on the image. Workflow Duplicate layer Filter → Other → High Pass (2–4px) Blend mode → Overlay Why it mattersKeeps original pixels untouched, perfect for export variants.

Read More
Visual Studio

Use Solution Filters to Load Only What You Need

- 26.01.26 - ErcanOPAK comment on Use Solution Filters to Load Only What You Need

Large solutions kill startup time and focus. Hidden feature: Solution Filters (.slnf) dotnet slnf create dotnet slnf add MyProject.csproj Why it mattersVisual Studio loads only required projects → faster boot, less RAM, more focus.

Read More
C#

Stop Boxing With in Parameters for Hot Paths

- 25.01.26 - ErcanOPAK comment on Stop Boxing With in Parameters for Hot Paths

void Process(in LargeStruct data) Why this mattersAvoids copies and reduces GC pressure.

Read More
C#

Use FrozenDictionary for Read-Heavy Workloads (.NET 8+)

- 25.01.26 - ErcanOPAK comment on Use FrozenDictionary for Read-Heavy Workloads (.NET 8+)

var map = myDict.ToFrozenDictionary(); Why this mattersOptimized lookups, thread-safe, zero mutation cost.

Read More
C#

Why record Types Reduce Bugs in DTOs

- 25.01.26 | 15.02.26 - ErcanOPAK comment on Why record Types Reduce Bugs in DTOs

The Problem: How many times have you created a simple class just to hold data (like a DTO or a config object), only to find yourself drowning in boilerplate code? You need properties, a constructor, and if you want to compare them, you have to override Equals() and GetHashCode(). Before you know it, a simple […]

Read More
SQL

Use EXISTS Instead of IN for Better Query Plans

- 25.01.26 - ErcanOPAK comment on Use EXISTS Instead of IN for Better Query Plans

SELECT * FROM Users u WHERE EXISTS ( SELECT 1 FROM Orders o WHERE o.UserId = u.Id ); Why this mattersEXISTS short-circuits; IN often materializes full sets.

Read More
SQL

Why COUNT(*) Can Be Slow on Large Tables

- 25.01.26 - ErcanOPAK comment on Why COUNT(*) Can Be Slow on Large Tables

Counting rows forces full scans. SELECT COUNT_BIG(*) FROM Orders WITH (NOLOCK); Why this mattersOn massive tables, counts are expensive — cache or approximate when possible.

Read More
Asp.Net Core / C#

Use IHttpClientFactory or Face Socket Exhaustion

- 25.01.26 - ErcanOPAK comment on Use IHttpClientFactory or Face Socket Exhaustion

Creating HttpClient per request is a silent killer. services.AddHttpClient(); Why this mattersConnection pooling prevents random production outages.

Read More
Asp.Net Core / C#

Why BackgroundService Beats Task.Run in APIs

- 25.01.26 - ErcanOPAK comment on Why BackgroundService Beats Task.Run in APIs

Fire-and-forget tasks die with requests. public class Worker : BackgroundService { protected override async Task ExecuteAsync(CancellationToken ct) { while (!ct.IsCancellationRequested) await DoWorkAsync(ct); } } Why this mattersHosted services respect app lifetime and graceful shutdown.

Read More
Git

Speed Up Large Repos with Partial Clones

- 25.01.26 - ErcanOPAK comment on Speed Up Large Repos with Partial Clones

Huge repo? Clone only what you need. git clone –filter=blob:none <repo> Why this mattersMassive bandwidth and disk savings for CI and dev machines.

Read More
Page 29 of 69
« Previous 1 … 24 25 26 27 28 29 30 31 32 33 34 … 69 Next »

Posts navigation

Older posts
Newer posts
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (858)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (754)
  • Add Constraint to SQL Table to ensure email contains @ (578)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (564)
  • Average of all values in a column that are not zero in SQL (531)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (489)
  • Find numbers with more than two decimal places in SQL (447)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (858)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (754)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com