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

Problem to use Scan with IMediatR #144

Open
MatheusXavier opened this issue Apr 9, 2021 · 2 comments
Open

Problem to use Scan with IMediatR #144

MatheusXavier opened this issue Apr 9, 2021 · 2 comments

Comments

@MatheusXavier
Copy link

I'm using IMediatR lib, so before Scrutor I registered my Queries like that:
services.AddTransient<IRequestHandler<FindPlaceQuery, Result<List<FindPlaceDto>>>, FindPlaceQueryHandler>();

Now, with Scan I did like that and it's wooking perfectly:

                scan.FromAssemblies(typeof(CreateClientCommand).GetTypeInfo().Assembly)
                    .AddClasses(classes => classes.AssignableTo(typeof(IRequestHandler<,>)))
                        .AsImplementedInterfaces()
                        .WithTransientLifetime()
                    .AddClasses(classes => classes.AssignableTo(typeof(INotificationHandler<>)))
                        .AsImplementedInterfaces()
                        .WithTransientLifetime()
                    .AddClasses()
                        .AsMatchingInterface());

But I have a different scenario where it doesn't work, when i'm using a generic type for my query the Scrutor could not solve de dependency:
services.AddTransient<IRequestHandler<GetConfigurationValueByKeyQuery<int>, int>, GetConfigurationValueByKeyQueryHandler<int>>()

@khellang
Copy link
Owner

khellang commented Apr 18, 2021

there's a lot of bugs in there

@jposert That's a pretty pathetic bug report. Any more details would be welcome. Preferably in a separate issue. Scrutor has 19,021,071 downloads and very few of those users (including you) have bothered to file a bug report, so either there's not "a lot of bugs in there" or they can't be very severe. I'm guessing it's the former and you're full of 💩😅 Looking forward to your proper bug report 😬

@zachrybaker
Copy link

guys, guys....

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

No branches or pull requests

3 participants