Hot Chocolate is a GraphQL server that can integrate with ASP.NET Core, but it doesn’t participate in the same dependency injection you may be used to. That means it’s not immediately clear how to get at the Session or User objects. Normally, you can access these things through an HttpContext. On a controller, you read […]
The .NET framework has had several different patterns for doing asynchronous work — the Task Parallel Library (TPL), the Event-based Asynchronous Pattern (EAP), and the Asynchronous Programming Model (APM), to name a few. Since they build on each other, if you’re not familiar with all of them, it can be difficult to understand how they […]
Software developers are great at recognizing patterns. Maybe it’s an inherent skill that draws us to this profession. Or maybe it’s the process of writing software that develops this skill. Either way, “don’t repeat yourself” (DRY) is a natural application of this skill. However, repetition in itself is not the enemy that this principle makes […]
Functional programming seems to be making its way into everything these days, and you can take advantage of it even if you’re not using a strictly functional language or toolset. The key is to think declaratively rather than imperatively.
My attitude toward CSS used to be that it is simply unmaintainable. If in the course of development, you think things like: These styles are already a mess, so I can’t make it any worse. I can’t figure out why this is getting overridden, so I’ll just use !important. It seems like these styles are […]
Source control is a vital part of software development, but you don’t always want it to keep track of everything. Passwords, temporary changes, and desperate debugging edits are best kept out of version control. I’ve found four effective ways to handle this.
While rewriting some validation logic recently, I got to thinking about how “validation” tends to be an umbrella term that covers related, but distinct, operations. So I went back to the basics in order to find more accurate terminology for each step of the process.
When it comes to writing documentation, nobody wants to do the job. And whatever documentation does get written is quickly outdated because nobody wants to update it, either. The most accurate documentation of how a system works is the code itself, but even “self-documenting” code falls short of describing why it was written that way. […]