if you want to improve performance then you better use the `TryGetValue` approach, now you're scanning the dictionary twice, once to check if the key is there and a second time to get the value

```CSharp
if( !StaticResourceDictionary.Dictionary.TryGetValue(assembly, out allTypes))
{
    allTypes = assembly.GetTypes();
    StaticResourceDictionary.Dictionary.Add(assembly, allTypes);
}
```