wolverine-net-cheat-sheet
Wolverine (.NET) Cheat Sheet
Vahid Arya 1/7/2026 0 14

Wolverine is a next-generation .NET mediator and messaging framework that combines:

  1. In-process Mediator (like MediatR)
  2. Message Bus / Publish-Subscribe
  3. Distributed Messaging (with external transports e.g., RabbitMQ, Azure Service Bus)
  4. HTTP Endpoint Handling via WolverineFx.Http (Wolverine’s own endpoint model)
  5. Durability / Outbox / Inbox patterns
  6. Code-generation-based high-performance pipeline 

At its core, Wolverine is centered around messages and handlers with minimal ceremony, favoring conventions and code-generation over heavy framework base classes. 

everyone-can-push-a-project-forward-by-sacrificing-technical-qualitya-true-technical-lead-advances-it-with-minimal-technical-compromise
Everyone can push a project forward by sacrificing technical quality,a true technical lead advances it with minimal technical compromise.
Vahid Arya 12/27/2025 0 13

Technical leadership isn’t about pleasing stakeholders at the expense of the product’s future.

Ignoring architecture, choosing outdated technologies, or dismissing technical risks may speed up delivery today,but it creates long-term costs, frustrated teams, and fragile systems.

Technical debt can be a conscious strategy. Choosing the wrong technology is a managerial failure.

A strong technical lead balances customer needs with technical quality, makes hard decisions early, and treats technical quality as what it really is: risk management for the future.

implementing-stateful-services-in-a-horizontally-scaled-architecture
Implementing Stateful Services in a Horizontally Scaled Architecture
Vahid Arya 12/23/2025 0 25

In modern cloud-native systems, managing state across multiple API calls can be tricky. Imagine an airline ticket purchase:
  1.  List flights & prices
  2.  Reserve a flight
  3.  Complete payment

If the price changes between steps, how do you ensure the user can still complete the process reliably?

Traditional 𝗦𝘁𝗶𝗰𝗸𝘆 𝗦𝗲𝘀𝘀𝗶𝗼𝗻𝘀 can help by routing a user to the same instance, but they come with drawbacks: tight coupling, failover risks, and uneven load distribution.

A more robust solution? 𝗦𝗵𝗮𝗿𝗲𝗱 𝗦𝘁𝗮𝘁𝗲 using Redis or NoSQL:
  • Store temporary state on each API call
  • Persist final state to the main database
  • Handle concurrency with 𝗢𝗽𝘁𝗶𝗺𝗶𝘀𝘁𝗶𝗰 𝗟𝗼𝗰𝗸𝗶𝗻𝗴
  • Ensure 𝗮𝘁𝗼𝗺𝗶𝗰 𝘂𝗽𝗱𝗮𝘁𝗲𝘀 using transactions or Lua scripts
  • Use 𝗶𝗱𝗲𝗺𝗽𝗼𝘁𝗲𝗻𝗰𝘆 𝗸𝗲𝘆𝘀 to prevent duplicate operations

In large distributed systems, adding a 𝗖𝗼𝗿𝗿𝗲𝗹𝗮𝘁𝗶𝗼𝗻 𝗜𝗗 alongside state makes debugging and tracing end-to-end workflows much easier.

Proper TTL, failure handling, and atomicity ensure your solution is 𝘀𝗰𝗮𝗹𝗮𝗯𝗹𝗲, 𝗿𝗲𝘀𝗶𝗹𝗶𝗲𝗻𝘁, 𝗮𝗻𝗱 𝗽𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝗼𝗻-𝗿𝗲𝗮𝗱𝘆.

rowversion-is-not-always-the-best-concurrency-solution
RowVersion Is Not Always the Best Concurrency Solution
Vahid Arya 12/20/2025 0 19

RowVersion is a blunt instrument for optimistic concurrency.

In EF Core, RowVersion treats every data mutation as concurrency-critical.
That assumption doesn’t always hold in real systems.

In read-heavy applications, entities often mix:

  • business-critical fields (e.g. Title)
  • system or statistical fields (e.g. ViewCount, LastSeen, HitCount)

With RowVersion:

  • a harmless counter increment
  • invalidates an in-progress business edit
  • and surfaces as a DbUpdateConcurrencyException

Not because of a semantic conflict ,
but because all mutations are treated equally.

A more intentional design is to scope concurrency to business intent, not storage changes.

Using [ConcurrencyCheck] on selected properties:

  • reduces false contention
  • preserves optimistic guarantees where they matter
  • improves UX without weakening data integrity

Concurrency is a modeling decision, not a framework default.
Design it around what should conflict, not what happened to change.

sending-an-email-using-google-smtp-in-net
Sending an Email Using Google SMTP in .NET
Vahid Arya 12/19/2025 0 26

Email notifications are still one of the simplest and most reliable ways to keep users informed in many applications.
For lightweight scenarios—such as alerts, confirmations, or internal notifications—using an SMTP server can be a practical and cost-effective solution.

In this article, we focus primarily on configuring and using Google App Passwords, and then briefly demonstrate how to send an email from a .NET application using Gmail’s SMTP server.
While Gmail is used as the example, the same concept applies to most SMTP providers.

ef-mapping-strategies-for-the-derived-types
EF mapping strategies for the derived types
Vahid Arya 12/12/2025 0 30

Have you ever wondered how EF maps inheritance hierarchies to database tables?

When working with inheritance in your domain model, Entity Framework Core must decide how to represent that hierarchy in the database. Although the class structure may look simple, EF Core has multiple strategies for mapping derived types, and each one has significant performance and storage implications.

By default, EF Core uses Table-Per-Hierarchy (TPH), but newer versions also support Table-Per-Type (TPT) and Table-Per-Concrete-Type (TPC). Choosing between them is not just a design decision—it affects query performance, insert/update costs, schema complexity, and scalability.

how-to-control-concurrency-without-killing-scaling-practical-formula
How to Control Concurrency Without Killing Scaling? (Practical Formula)
Vahid Arya 12/7/2025 0 38

Most developers analyze their system design by designing a system that keeps latency constant as throughput increases. Of course, this definition is correct, but the point is that in this regard, more attention is paid to the scaling category (focusing on horizontal scaling) and all the solutions offered are in line with this concern. And the point that always remains is the consistency and concurrency category. Many developers forget that for all software with a very serious and important problem that lurks like a hidden danger to seriously affect constancy and throughput. The name of the problem? concurrency

Now the point is that all the solutions proposed to solve this problem neutralize and make ineffective all or at least a large part of the measures taken to scale and increase throughput

But...

Wait

Is this really the case?

high-efficiency-bulk-data-techniques-for-ef-core
High-Efficiency Bulk Data Techniques for EF Core
Vahid Arya 11/16/2025 0 52

A bulk operation refers to the process of inserting, updating, or deleting a large number of records in a database in a single, optimized command or batch, rather than executing individual statements for each row.

This is critically important for performance in data-intensive applications(e.g. as ETL processes, migrations, or real-time analytics) because it reduces network latency, minimizes transaction log overhead, and can improve throughput by 10x to 100x compared to row-by-row operations.

 

So now that we understand the importance of the topic, let's take a look at ef's support for bulk operations and see if functions like AddRange() and RemoveRange() are considered bulk operations or not.

software-engineering-slang-jargon-idioms
software-engineering slang / jargon / idioms
Vahid Arya 11/8/2025 0 41

words developers often throw around casually, but that have specific meanings or connotations.

In developer culture, words like boilerplate, spaghetti code, yak shaving, bike-shedding, and technical debt are shortcuts — they carry a whole concept and mood in one phrase.

Here’s a curated list of common developer terms, metaphors, and slang (with plain explanations and tone).

record-vs-record-struct-in-dotnet
record 🆚 record struct in dotnet
Vahid Arya 10/26/2025 0 50

Record type or record is a very interesting feature introduced in C# 9.0 , everything is considered immutable, and similarly, in C#, record types help us to work with immutable types.

1 2 3
Stay in touch with us.

(+98)9192962583

info@redmask.ir

paint-brush
Follow Me

© vahid arya. All Rights Reserved.