Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
When the Status Column Is Updated from Everywhere: Transition Tables, State Machines and Status History
Stop treating the status column as a field any endpoint can write: let the client send an action instead of a status, keep allowed transitions in one place (a transition table, domain methods or Stateless), write every transition with its reason to a status history in the same transaction, and use a rowversion to stop double approvals.
How C# async/await Works: The State Machine and Continuations
await does not always wait: on a finished task the code continues on the same thread. What the async keyword actually does, the GetAwaiter/IsCompleted/OnCompleted steps, a working hand-written state machine, looking at the compiler-generated type with reflection (a class in Debug, a struct in Release), which thread runs the continuation, and the awaitable pattern.