I recently started using Tuples in my repositories as a way to achieve self-documenting code. For example, let’s say that you have a simple application that returns only 2 entities in 1 call. You could write 2 methods on your repository and then call them both from your service layer, as is common. However, I think in such situations you’d be better served combining the entity calls in the repo and receiving them in your service layer so that looking at the code base, it’s clear that certain entities are only needed for certain operations. It can also help make your repositories more lean in certain situations.
Thanks for reading, if you read up to this, consider getting yourself a Hardcore .NET Core Developer Sticker Pack:
Today, I'll walk you through creating a production-ready Express API running on AWS Lambda with a persistent MongoDB data store. Yes, that's a thing, you can build Express apps on AWS Lambda. Amazing, I know! And yes, you can use MongoDB without batting an eye!