Skip to content

Commit 6cb6cda

Browse files
authored
Fixed missing parameters in api footprint (#14)
1 parent 7b4961a commit 6cb6cda

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

nanoFramework.DependencyInjection/DependencyInjection/ActivatorUtilities.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ public static object CreateInstance(IServiceProvider provider, Type instanceType
5555
/// </summary>
5656
/// <param name="provider">The service provider.</param>
5757
/// <param name="type">The type of the service.</param>
58+
/// <param name="parameters">Constructor arguments not provided by the <paramref name="provider"/>.</param>
5859
/// <returns>The resolved service or created instance.</returns>
5960
/// <exception cref="InvalidOperationException">Unable to resolve a service while attempting to activate a constructor.</exception>
60-
public static object GetServiceOrCreateInstance(IServiceProvider provider, Type type)
61+
public static object GetServiceOrCreateInstance(IServiceProvider provider, Type type, params object[] parameters)
6162
{
62-
return provider.GetService(type) ?? CreateInstance(provider, type);
63+
return provider.GetService(type) ?? CreateInstance(provider, type, parameters);
6364
}
6465

6566
private struct ConstructorMatcher

nanoFramework.DependencyInjection/DependencyInjection/ServiceProviderEngine.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ private object[] GetServiceObjects(Type serviceType)
134134
else
135135
{
136136
var instance = Resolve(descriptor.ImplementationType);
137-
{
138-
descriptor.ImplementationInstance = instance;
139-
}
137+
descriptor.ImplementationInstance = instance;
140138

141139
services.Add(instance);
142140
}

0 commit comments

Comments
 (0)