Skip to content

Commit

Permalink
Add extensions for open-generics
Browse files Browse the repository at this point in the history
  • Loading branch information
hadashiA committed Jan 10, 2024
1 parent d37fb21 commit 5c77ef7
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ public static RegistrationBuilder Register(
? new OpenGenericRegistrationBuilder(type, lifetime)
: new RegistrationBuilder(type, lifetime));

public static RegistrationBuilder Register(
this IContainerBuilder builder,
Type interfaceType,
Type implementationType,
Lifetime lifetime)
{
return builder.Register(implementationType, lifetime).As(interfaceType);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static RegistrationBuilder Register<T>(
this IContainerBuilder builder,
Expand Down

0 comments on commit 5c77ef7

Please sign in to comment.