CR Feedback

This commit is contained in:
Yishai Galatzer 2014-02-12 09:15:16 -08:00
parent cc3fec2f76
commit 1f9d4969a7
1 changed files with 2 additions and 6 deletions

View File

@ -34,12 +34,8 @@ namespace Microsoft.AspNet.Mvc
var controller = ActivatorUtilities.CreateInstance(_serviceProvider, descriptor.ControllerType);
// TODO: How do we feed the controller with context (need DI improvements)
var contextProperty =
#if NET45
descriptor.ControllerType.GetProperty("Context");
#else
descriptor.ControllerType.GetRuntimeProperty("Context");
#endif
var contextProperty = descriptor.ControllerType.GetRuntimeProperty("Context");
if (contextProperty != null)
{
contextProperty.SetMethod.Invoke(controller, new [] { context });