For decades developers have fought over null types. What do they mean? Why is there a silly little question mark in my C# code? What is consciousness? These are all topics that we will tackle in this blog post. Prerequisite In order to correctly understand nulls you must know the…
Model State in .NET Core (Explained Simply)
When we first start building API’s we make many assumptions about our users. We assume that they would never input bad data. This is very unrealistic. Have you ever experienced the frustration of filling out a long form at the dentist office? This is the exact same feeling users have…
FirstOrDefault in EF Core (Explained Simply)
Many times in life we just want one thing. This is no exception for C# and when we are working with database entities. When you want a single entity from a database, you will be given the choice of a few methods: FirstOrDefault() FirstOrDefault() returns the first element that satisfies…
Repository Pattern Explained Simply
Repository Pattern is likely the only design pattern you will implement as software developer. %99 of software design patterns are very rarely implemented, but the repository pattern is something you will see everyday. First, let’s just see a Repository Pattern and what it is: All this code does is get…
Async/Await in C# Explained Simply
Asynchronous programming is simply a way to make a computer do two things at once. In .NET Core, it is almost required to write high performance servers that can communicate with multiple clients. An asynchronous model allows multiple things to happen at the same time and doesn’t block the flow…
CreatedAtAction in ASP.NET Core Explained Simply
CreatedAtAction is a helper function that is typically used in POST and creation API requests. This method is not new by any means but it seems that the days of plain Ok() and Created() are over as more and more people shift. But why do we need a fancy helper…
Many-To-Many Relationships in EF Core Explained Simply
A many-to-many relationship is conceptually similar to two many-to-one relationships connected to each other. While the history of of many-to-many relationships (or who created them) is a mystery, my theory is that the creators saw the limitations of one-to-many. A one-to-many can ONLY have exactly what it says: one parent…
Interfaces Explained Simply
Understanding what interfaces are and why we use them can be a real issue when first starting to code. The real reason we use interfaces is because (like any other programming concept) we are trying to stop duplication. Interfaces are way better at stopping duplication compared to inheritance; hence why…
EF Core “Underneath The Hood”
Getting up and running with EF Core is easy, but it often pays dividends to understand how underlying technologies work. My aim is to provide a solid mental model of what’s going on when you actual access the database. Modeling When we first start programming, rarely do we ever start…
Application DbContext Explained Simply
Arguably the most important part of Entity Framework is the DbContext. It’s basically a giant object you create with methods to get things out of a database. Another important aspect of the Application DbContext is that it configures things like the database address, tables, and event advanced relationships for the…