Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Value Types delegate registration #521

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

slimshader
Copy link
Contributor

Fix for #489

@vercel
Copy link

vercel bot commented May 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vcontainer ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2023 3:27pm

@AlonTalmi
Copy link
Contributor

I get compile error when removing the constraint without casting the delegate like so:

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static RegistrationBuilder Register<TInterface>(
    this IContainerBuilder builder,
    Func<IObjectResolver, TInterface> implementationConfiguration,
    Lifetime lifetime)
{
    return builder.Register(new FuncRegistrationBuilder(Create, typeof(TInterface), lifetime));
    object Create(IObjectResolver resolver) => implementationConfiguration(resolver);
}

@hadashiA
Copy link
Owner

👍

@hadashiA hadashiA merged commit 2b972fe into hadashiA:master Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants