From 535fdf3356f4237ff8dfc0fdaa71842f5a525a63 Mon Sep 17 00:00:00 2001 From: apxoht Date: Fri, 20 Nov 2015 21:31:59 +0200 Subject: [PATCH] Removed unnecessary call to MetadataProvider.GetModelExplorerForType in Controller.TryValidateModel --- src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs index 57518191a3..677e1a7dd6 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs @@ -1756,9 +1756,7 @@ namespace Microsoft.AspNet.Mvc { throw new ArgumentNullException(nameof(model)); } - - var modelExplorer = MetadataProvider.GetModelExplorerForType(model.GetType(), model); - + var modelName = prefix ?? string.Empty; // Clear ModelStateDictionary entries for the model so that it will be re-validated.