I just trying to figuring out if it possible to implement locking mechanism inside class which inherited from the interface and injected with scoped lifetime. I would like to know, if lock mechanism have same thread lock behaviour mechanism as on singleton class or it's completely different? If so, in which direction I should move to achieve locking mechanism whether if it's possible for scoped objects.
For example, I've 2 requests which are trying to read data and cache it, for the first request I would like to block read method, read it's data, move it to cache and then release the lock and retrieve the response. For the 2nd request I would like read it from the cache instead of using another algorithm for reading data.
Maybe I've an wrong vision of how it's working, but as I understood, for the scoped objects, lock will be used only in the first request and would not block second request, am I right?