C# Read-Only Collections and LSP
I often see programmers saying that .NET read-only collections violate Liskov Substitution Principle. Do they? The quick answer is no but let’s go through the whole story first.
CQS with Database-Generated Ids
Mark Seemann brings up a very interesting subject in his post: how to fit Command Query Separation principleĀ in case you have to save a brand-new object in a database and also need the created id back? Sure, you can have GUIDs for identifiers (which have some drawbacks as I’ll show later on), but what if you really need integers? I’ve been asked the same question for several times, so in this post I’ll share the solution I use for this problem.
Entity Base Class
If you follow DDD principles, you eventually end up creating a base class for all the domain entities. It’s a good idea as it allows you to gather common logic in one place. When you decide to do that, you inevitably face the question of what exactly should be included in that base entity and how it should be presented.
What is enterprise development?
It’s the first post on the blog I’m starting today. The idea to start blogging was with me quite for a while, so I decided to give it a try.