Update CustomValidationAttributeAdapterProvider.cs - Use is an… (#15409)

Use is & cast operator of C# 7
pull/15413/head
Marcel 2019-10-31 15:44:01 +01:00 committed by Scott Addie
parent f102307182
commit 98b7a1625d
1 changed files with 2 additions and 3 deletions

View File

@ -18,10 +18,9 @@ namespace ValidationSample.Attributes
public IAttributeAdapter GetAttributeAdapter(ValidationAttribute attribute,
IStringLocalizer stringLocalizer)
{
if (attribute is ClassicMovieAttribute)
if (attribute is ClassicMovieAttribute classicMovieAttribute)
{
return new ClassicMovieAttributeAdapter(
attribute as ClassicMovieAttribute, stringLocalizer);
return new ClassicMovieAttributeAdapter(classicMovieAttribute, stringLocalizer);
}
else
{