Why IsNullOrEmpty check of an enumerable part of Microsoft.IdentityModel.Tokens?

438 Views Asked by At

I found a code today where an enumerable is being checked for null or empty using static IsNullOrEmpty method exposed through Microsoft.IdentityModel.Tokens.

Now in Microsoft documentation it is listed under confidential client. My question is around the usage of it. Can this be used for any enumerable in any use case or is it recommended to use it in certain use cases? I don't find it normal to use such a functionality exposed by Microsoft.IdentityModel.Tokens. What could have been the intention? https://learn.microsoft.com/en-us/dotnet/api/microsoft.identitymodel.tokens.collectionutilities.isnullorempty?view=msal-web-dotnet-latest

1

There are 1 best solutions below

0
haroonie On

The extension Microsoft.IdentityModel.Tokens.CollectionUtilities.IsNullOrEmpty was incorrectly exposed as a public method and will be changed to internal in a later release of IdentityModel.

Conflict with Microsoft.IdentityModel.Tokens.CollectionUtilities.IsNullOrEmpty extension - Github.com

Make CollectionUtilities Internal - Github.com