Skip to content

MemoryCache.GetValues method implementation incorrect #1422

Open
@sergethedev17

Description

@sergethedev17

Documentation for MemoryCache.GetValues(IEnumerable, String) Method specifies that:

Returns
IDictionary<String,Object>
A set of cache entries that correspond to the specified keys.

Remarks
If a cache entry that is represented by the keys does not exist, the corresponding value for the returned object in the dictionary is set to null. Therefore, the returned dictionary always has the same number of items as the number of elements in keys.

GetValues implementation is different.

  1. First, null entries corresponding to keys that do not exist are not added.

  2. Second, if none of the keys are found, then method returns null instead of IDictionary<String,Object>.

We need to either update documentation or patch the implementation.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions