From 268617ddbaa78f893031f2ced235b2b21c6346c9 Mon Sep 17 00:00:00 2001 From: apxoht Date: Tue, 4 Oct 2016 14:59:37 +0300 Subject: [PATCH] DefaultViewComponentFactory no longer allocates new lambda delegate on each call to CreateViewComponent --- .../ViewComponents/DefaultViewComponentFactory.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewComponents/DefaultViewComponentFactory.cs b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewComponents/DefaultViewComponentFactory.cs index 5c3e23315a..f0f77ac59d 100644 --- a/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewComponents/DefaultViewComponentFactory.cs +++ b/src/Microsoft.AspNetCore.Mvc.ViewFeatures/ViewComponents/DefaultViewComponentFactory.cs @@ -59,11 +59,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewComponents { var propertiesToActivate = _injectActions.GetOrAdd( viewComponent.GetType(), - type => - PropertyActivator.GetPropertiesToActivate( - type, - typeof(ViewComponentContextAttribute), - CreateActivateInfo)); + _getPropertiesToActivate); for (var i = 0; i < propertiesToActivate.Length; i++) {