Removed unnecessary call to MetadataProvider.GetModelExplorerForType in Controller.TryValidateModel

This commit is contained in:
apxoht 2015-11-20 21:31:59 +02:00 committed by Ryan Nowak
parent 8682fe0cfd
commit 535fdf3356
1 changed files with 1 additions and 3 deletions

View File

@ -1756,9 +1756,7 @@ namespace Microsoft.AspNet.Mvc
{ {
throw new ArgumentNullException(nameof(model)); throw new ArgumentNullException(nameof(model));
} }
var modelExplorer = MetadataProvider.GetModelExplorerForType(model.GetType(), model);
var modelName = prefix ?? string.Empty; var modelName = prefix ?? string.Empty;
// Clear ModelStateDictionary entries for the model so that it will be re-validated. // Clear ModelStateDictionary entries for the model so that it will be re-validated.