I have a dictionary
private readonly Dictionary<int, BinaryAssetExtensionDto> _identityMap;
And I would like to do something like this:
if(_identityMap.Values.Contains(x => x.extension == extension))...
This is possible because the previous code does not work.
Now I do it like this:
var result = _identityMap.Values.ToList().Find(x => x.extension == extension); if (result != null) return result;
source share