The classical approach to unit testing with Entity Framework involves mocking the database context. With Entity Framework Core we no longer need to use a library like moq or even use mocking any longer. Instead, we’re going to use Entity Framework Core’s in memory database.Continue reading “Testing with Entity Framework Core”
If you’re working with SQL Server, chances are good that you have come across the need to create an index on a guid column. In some cases, although I don’t advise it, guids are used as the primary keys on every table. This typically results in a clustered index on these columns. Other times you may need to use a unique identifier as a secondary Id on an entity for business reasons, such as an employee id. Regardless of which type of index you use or your reasons for doing so, index fragmentation becomes a bigger issue with guids.Continue reading “Index on SQL Server Guid Column”
For those who aren’t familiar, there is a concept in Domain Driven Design that distinguishes between objects with identity (entities) and those without (value objects). When we model the domain we typically think in terms of entities which are then persisted and modified over time. They form the basis for which we describe the business and interact with it, and often times, entities are the only objects developers create when modeling the system. Value objects provide a wealth of benefits though when applied appropriately.