© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
2 replies
RDasher

❔ MongoDB: Cache conventions

Hello, I'm trying to figure out what's a better convention for caching records in my API application.
What I currently do:
public IEnumerable<T> Table(FilterDefinition<T> _Filter) => _DBSet.Find(_Filter).ToList();
public IEnumerable<T> Table(FilterDefinition<T> _Filter) => _DBSet.Find(_Filter).ToList();

Depending on the filters I have selected (list search page, finding a specific record, etc), I send that as a filter definition into the
MongoDb<T>.Find(_Filter)
MongoDb<T>.Find(_Filter)
method.
Now for the sake of caching, these filter definitions would not work if I'm correct, so I would need to first load all records into Cache, then do filtering.

What's the recommended way of doing this?
>Create Filter Query -> Search Db -> Get Results
>Get All Results -> Create Filter Query -> Query Results
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Problem with MongoDB EF Core Provider Conventions
C#CC# / help
3mo ago
Class Naming Conventions
C#CC# / help
3y ago
Naming conventions [Answered]
C#CC# / help
4y ago
Naming conventions with Dto
C#CC# / help
2y ago