From a5a3eb44b9a23ff2fe4e8f64641c060088fbb1c9 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Tue, 13 Jan 2015 11:09:53 -0800 Subject: [PATCH] Activation behavior modification made easier - Made Activate method virtual - Changed IReadOnlyDictionary to IDictionary --- src/Microsoft.AspNet.Mvc.Core/DefaultControllerActivator.cs | 6 +++--- .../ViewComponents/DefaultViewComponentActivator.cs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.Core/DefaultControllerActivator.cs b/src/Microsoft.AspNet.Mvc.Core/DefaultControllerActivator.cs index c27c1b9e77..69c95be847 100644 --- a/src/Microsoft.AspNet.Mvc.Core/DefaultControllerActivator.cs +++ b/src/Microsoft.AspNet.Mvc.Core/DefaultControllerActivator.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc public class DefaultControllerActivator : IControllerActivator { private readonly Func[]> _getPropertiesToActivate; - private readonly IReadOnlyDictionary> _valueAccessorLookup; + private readonly IDictionary> _valueAccessorLookup; private readonly ConcurrentDictionary[]> _injectActions; /// @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.Mvc /// /// The controller to activate. /// The context of the executing action. - public void Activate([NotNull] object controller, [NotNull] ActionContext context) + public virtual void Activate([NotNull] object controller, [NotNull] ActionContext context) { var controllerType = controller.GetType(); var controllerTypeInfo = controllerType.GetTypeInfo(); @@ -58,7 +58,7 @@ namespace Microsoft.AspNet.Mvc } } - protected virtual IReadOnlyDictionary> CreateValueAccessorLookup() + protected virtual IDictionary> CreateValueAccessorLookup() { var dictionary = new Dictionary> { diff --git a/src/Microsoft.AspNet.Mvc.Core/ViewComponents/DefaultViewComponentActivator.cs b/src/Microsoft.AspNet.Mvc.Core/ViewComponents/DefaultViewComponentActivator.cs index 873dfb1c3d..889dfc2444 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ViewComponents/DefaultViewComponentActivator.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ViewComponents/DefaultViewComponentActivator.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNet.Mvc public class DefaultViewComponentActivator : IViewComponentActivator { private readonly Func[]> _getPropertiesToActivate; - private readonly IReadOnlyDictionary> _valueAccessorLookup; + private readonly IDictionary> _valueAccessorLookup; private readonly ConcurrentDictionary[]> _injectActions; /// @@ -32,7 +32,7 @@ namespace Microsoft.AspNet.Mvc } /// - public void Activate([NotNull] object viewComponent, [NotNull] ViewContext context) + public virtual void Activate([NotNull] object viewComponent, [NotNull] ViewContext context) { var propertiesToActivate = _injectActions.GetOrAdd(viewComponent.GetType(), _getPropertiesToActivate); @@ -48,7 +48,7 @@ namespace Microsoft.AspNet.Mvc /// Creates a lookup dictionary for the values to be activated. /// /// Returns a readonly dictionary of the values corresponding to the types. - protected virtual IReadOnlyDictionary> CreateValueAccessorLookup() + protected virtual IDictionary> CreateValueAccessorLookup() { return new Dictionary> {