Skip to content

Commit

Permalink
Inline PropertyInjector::Inject
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavopsantos committed Dec 19, 2023
1 parent 6a8980f commit d90a5e2
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions Assets/Reflex/Injectors/PropertyInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@ public static void InjectMany(PropertyInfo[] properties, object instance, Contai
{
for (var i = 0; i < properties.Length; i++)
{
Inject(properties[i], instance, container);
}
}

private static void Inject(PropertyInfo property, object instance, Container container)
{
try
{
property.SetValue(instance, container.Resolve(property.PropertyType));
}
catch (Exception e)
{
throw new PropertyInjectorException(e);
try
{
var property = properties[i];
property.SetValue(instance, container.Resolve(property.PropertyType));
}
catch (Exception e)
{
throw new PropertyInjectorException(e);
}
}
}
}
Expand Down

0 comments on commit d90a5e2

Please sign in to comment.