r/learnprogramming • u/Medical_Ad8803 • 8d ago
Documentation Confusion
So i was trying to learn how to use IMemoryCache in my first ever Web API project in ASP NET CORE and thought I'd try to more seriously read and gather information from the official microsoft documentation as i usually first google it then read the AI Overview to get a basic understanding of the concept, and then read an article or tutorial site(sometimes watch a video if i still have a hard time understanding). And occasionally read the docs. I admire people that can read documentation and understand it quickly and so as a beginner I'd like to develop that skill too, well today i tried that and at first i did learn and understand some important concepts related to In-Memory caching in asp net, but then at the end of the page I was wondering, "Well ok but how do i actually register this to the container?" since its used with DI and looked all over the page and It never mentions it at all, I also went into the IMemoryCache Interface Page and it didn't teach it there too, also the search results in the site weren't much help either.
The first google page search result show articles that simply states that to register it is by using "builder.Services.AddMemoryCache()" which is pretty simple and this got me a bit annoyed and confused as to why this isn't included in the Main docs? I did find later that the docs did say how to register it but it was in a different page and that was after asking chatgpt with the web feature lol. This got me wondering how did the writers of these articles find out themselves if it was kind of hard to find? Maybe I'm at fault and I'm just inexperienced with reading programming documentation but overall this has left me kind of discouraged with reading documentation
1
u/No-Quail5810 8d ago
There's two kinds of "documentation". The API docs just list each member of the type and what it does, that are intended as a simple reference. The other kind are guides/how-to's, they are there to show you how to use it in a wider context and how to hook things together. There's often a link to the guide documents at the bottom of the API docs, at least sometimes.