Convert type checks and null checks into pattern matching

This commit is contained in:
Patrick Barron
2020-04-05 12:07:43 -04:00
parent 29539174a3
commit 5966ee6d87
9 changed files with 24 additions and 54 deletions

View File

@@ -82,8 +82,7 @@ namespace MediaBrowser.Api.UserLibrary
{
var parent = GetParentItem(request);
var collectionFolder = parent as IHasCollectionType;
if (collectionFolder != null)
if (parent is IHasCollectionType collectionFolder)
{
return collectionFolder.CollectionType;
}