Skip to content

Sponsor: Do you build complex software systems? See how NServiceBus makes it easier to design, build, and manage software systems that use message queues to achieve loose coupling. Get started for free.

Learn more about Software Architecture & Design.
Join thousands of developers getting weekly updates to increase your understanding of software architecture and design concepts.


Follow @CodeOpinion

ASP.NET Core

Sensitive Configuration Data in ASP.NET Core

While working on my new side-project in ASP.NET Core, I was at the point where I needed to start storing sensitive configuration data. Things like my DocumentDB Auth Key, Google OAuth ClientId & Secret, Twilio Auth Token, etc. Depending on your context you may not want to be storing these types of application settings in configuration files that are committed to source control. As you would expect, my local environment for development and once I deploy to Azure have completely different configurations. So how do you change the configuration from local to production? If you are used to using appSettings from the app.config… Read More »Sensitive Configuration Data in ASP.NET Core

Optimistic Concurrency in Azure Cosmos DB

I’ve started working on new side project using ASP.NET Core.  I wanted to try a new datastore and decided to give Azure Cosmos DB a try. This project isn’t doing anything complicated but does contain enough real world use cases that can give me an idea of how the API works. Concurrency The first thing I needed to implement was how to handle concurrency.  Specifically optimistic concurrency. In an optimistic concurrency model, a violation is considered to have occurred if, after a user receives a value from the database, another user modifies the value before the first user has attempted to modify it.… Read More »Optimistic Concurrency in Azure Cosmos DB

MediatR Behaviors

I was happy and surprised to see that MediatR v3.0 was released yesterday.  One of the new features, which I was really looking forward to are pipeline behaviors. A pipeline behavior is an implementation of IPipelineBehavior<TRequest, TResponse>. It represents a similar pattern to filters in ASP.NET MVC/Web API or pipeline behaviors in NServiceBus. Changes There are a couple major breaking changes to v3.  All of them I’m fairly happy about actually. Messages There is no distinction between sync, async (cancellable) requests or notifications. You simply implement either IRequest or INotification. You must still create the appropriate handler via either IRequestHandler, IAsyncRequestHandler, ICancellableAsyncRequestHandler. Async To… Read More »MediatR Behaviors