From 22e9c0fe2fb786ef7324d60ee1a7188bf2577db0 Mon Sep 17 00:00:00 2001 From: hadashi Date: Sat, 13 Feb 2021 09:48:54 +0900 Subject: [PATCH] Fix .WithParameter argument strictly --- .../Assets/VContainer/Runtime/RegistrationBuilder.cs | 2 +- .../Runtime/Unity/ContainerBuilderUnityExtensions.cs | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/VContainer/Assets/VContainer/Runtime/RegistrationBuilder.cs b/VContainer/Assets/VContainer/Runtime/RegistrationBuilder.cs index 46409622..98138717 100644 --- a/VContainer/Assets/VContainer/Runtime/RegistrationBuilder.cs +++ b/VContainer/Assets/VContainer/Runtime/RegistrationBuilder.cs @@ -108,7 +108,7 @@ public RegistrationBuilder WithParameter(Type type, object value) return this; } - public RegistrationBuilder WithParameter(object value) + public RegistrationBuilder WithParameter(TParam value) { return WithParameter(typeof(TParam), value); } diff --git a/VContainer/Assets/VContainer/Runtime/Unity/ContainerBuilderUnityExtensions.cs b/VContainer/Assets/VContainer/Runtime/Unity/ContainerBuilderUnityExtensions.cs index 8c6636e9..7dce1210 100644 --- a/VContainer/Assets/VContainer/Runtime/Unity/ContainerBuilderUnityExtensions.cs +++ b/VContainer/Assets/VContainer/Runtime/Unity/ContainerBuilderUnityExtensions.cs @@ -64,14 +64,12 @@ public static void UseEntryPoints( Lifetime lifetime, Action configuration) { - var entryPoints = new EntryPointsBuilder(builder, lifetime); - configuration(entryPoints); + configuration(new EntryPointsBuilder(builder, lifetime)); } public static void UseComponents(this IContainerBuilder builder, Action configuration) { - var components = new ComponentsBuilder(builder); - configuration(components); + configuration(new ComponentsBuilder(builder)); } public static void UseComponents( @@ -79,8 +77,7 @@ public static void UseComponents( Transform root, Action configuration) { - var components = new ComponentsBuilder(builder, root); - configuration(components); + configuration(new ComponentsBuilder(builder, root)); } public static RegistrationBuilder RegisterEntryPoint(this IContainerBuilder builder, Lifetime lifetime)