@@ -200,7 +200,7 @@ public T AddResource<T>(string key, T resource)
200200 /// <returns>True if the resource exists, false otherwise</returns>
201201 public bool TryGetResource < T > ( string key , out T resource )
202202 {
203- if ( _resources != null && _resources . TryGetValue ( key , out var objResource ) && objResource is T tResource )
203+ if ( _resources is not null && _resources . TryGetValue ( key , out var objResource ) && objResource is T tResource )
204204 {
205205 resource = tResource ;
206206 return true ;
@@ -234,7 +234,7 @@ public T GetResource<T>(string key)
234234 /// <returns>The resource that was removed, if any</returns>
235235 public T RemoveResource < T > ( string key )
236236 {
237- if ( _resources != null && _resources . TryGetValue ( key , out var objResource ) )
237+ if ( _resources is not null && _resources . TryGetValue ( key , out var objResource ) )
238238 {
239239 _resources . Remove ( key ) ;
240240 if ( objResource is T resource )
@@ -255,7 +255,7 @@ public T RemoveResource<T>(string key)
255255 public T RemoveAndDisposeResource < T > ( string key )
256256 where T : IDisposable
257257 {
258- if ( _resources != null && _resources . TryGetValue ( key , out var objResource ) )
258+ if ( _resources is not null && _resources . TryGetValue ( key , out var objResource ) )
259259 {
260260 _resources . Remove ( key ) ;
261261 if ( objResource is T resource )
@@ -309,7 +309,7 @@ internal T RemoveAndDisposeResource<T>(TypedResourceKey<T> key)
309309 /// </summary>
310310 public void ClearAndDisposeResources ( )
311311 {
312- if ( _resources != null )
312+ if ( _resources is not null )
313313 {
314314 foreach ( var kvp in _resources )
315315 {
0 commit comments