Update CustomValidationAttributeAdapterProvider.cs - Use is an… (#15409)
Use is & cast operator of C# 7pull/15413/head
parent
f102307182
commit
98b7a1625d
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue