Reviewing everything we've done

Let's compare our old solution side by side with our new one and review all of the things we've done up to this point.

  • We removed the in-memory repository and replaced it with a real actual database, SQLite.
  • We seeded that database with some data.
  • We extended the get all employees endpoint and added ways to filter and paginate the data.
  • We changed the way we modeled and handled benefits.

Reviewing the implication of using request objects

We made a decision very early on to use request objects to pass around data as opposed to using entities. I think this decision has paid off in a big way:

  • It leaves entities to do what they do best - represent and store data.
  • It allows us to not have to do weird things like add JSON attributes to not render empty nav properties as JSON.
  • It respects the Single Responsibility Principle - each thing has one job and it's easy to understand what that job is.

For the remainder of the course

I'm going to show you a bit more EF/ASP.NET Core plumbing - a couple of tricks that I've picked up over the years that I think are pretty cool. I'm also going to talk about how we can use Testcontainers to make our lives easier when testing, as well as some things about security.