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

Tackling Technical Debt using NDepend

Technical debt is an interesting term in our industry.  To a certain degree I feel like its a bit overloaded now.  Everyone has a slight variation of what their definition of it is.  I often think the variation revolves around Fowler’s “reckless vs prudent, the second, deliberate vs inadvertent.”. Regardless, I think the general concept that is in everyone’s definition is that technical debt, if not paid back over time, can cause a code base to be unmanagable.  The length of time to deliver value increases because of the complexity. Just a refresher per Ward Cunningham: Shipping first time code is like… Read More »Tackling Technical Debt using NDepend

EF Core Multi-Tenancy: Query Filter

There are many different ways to handle multi-tenancy.  This blog post will cover one approach to EF Core Multi-Tenancy that will work if you are using a shared database approach, meaning you use the same database for multiple tenants, that are disambiguated using tenant ID column. If you want more details on Multi-Tenancy, check out the Microsoft Docs on the topic, related to designing multi-tenant apps using Azure SQL Database. Entity Let’s jump right into some sample code of a simple Entity that represents a customer.  Notice the TenantId. View the code on Gist. Filter The approach we are going… Read More »EF Core Multi-Tenancy: Query Filter

Entity Framework Code First Model Cache

With the release of Entity Framework 6.2, it introduces the Entity Framework Code First Model Cache.  Giving you the ability to load a prebuilt edmx when using code first, instead having EF generate it on startup. This can provide a some savings on startup time. With these changes, first AppDomain calls to context.Database.Initialize for a model with just over 600 models and a null initializer dropped from 12-14 seconds to about 1.9 seconds after the edmx was written, saving 10-12 seconds on initialization. The first call to write the edmx still ran in 12-14 seconds (no noticeable delay added). #275… Read More »Entity Framework Code First Model Cache