From 98b7a1625d4fb6b2e72572ce34e39ff50f6cd6fe Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 31 Oct 2019 15:44:01 +0100 Subject: [PATCH] =?UTF-8?q?Update=20CustomValidationAttributeAdapterProvid?= =?UTF-8?q?er.cs=20-=20Use=20is=20an=E2=80=A6=20(#15409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use is & cast operator of C# 7 --- .../Attributes/CustomValidationAttributeAdapterProvider.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aspnetcore/mvc/models/validation/sample/Attributes/CustomValidationAttributeAdapterProvider.cs b/aspnetcore/mvc/models/validation/sample/Attributes/CustomValidationAttributeAdapterProvider.cs index e271605839..acacddb399 100644 --- a/aspnetcore/mvc/models/validation/sample/Attributes/CustomValidationAttributeAdapterProvider.cs +++ b/aspnetcore/mvc/models/validation/sample/Attributes/CustomValidationAttributeAdapterProvider.cs @@ -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 {