Fix build issues with Injector
This was causing intellisense failures in VS. It looks like the commandline is able to accidentally pick up the compatability extensions from the model binding assembly, but this is not the case in VS. Changed this code not to rely on compatability extensions.
This commit is contained in:
parent
44af396da9
commit
ffb73a1ed8
|
|
@ -32,7 +32,12 @@ namespace Microsoft.AspNet.Mvc
|
|||
{
|
||||
var type = obj.GetType();
|
||||
|
||||
var property = type.GetProperty(propertyName);
|
||||
var property = type.GetRuntimeProperty(propertyName);
|
||||
if (property == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (property.PropertyType.IsAssignableFrom(typeof(TProperty)))
|
||||
{
|
||||
property.SetValue(obj, value);
|
||||
|
|
@ -43,7 +48,12 @@ namespace Microsoft.AspNet.Mvc
|
|||
{
|
||||
var type = obj.GetType();
|
||||
|
||||
var property = type.GetProperty(propertyName);
|
||||
var property = type.GetRuntimeProperty(propertyName);
|
||||
if (property == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (property.PropertyType.IsAssignableFrom(typeof(TProperty)))
|
||||
{
|
||||
property.SetValue(obj, services.GetService<TProperty>());
|
||||
|
|
|
|||
Loading…
Reference in New Issue