mrpmorris / Fluxor

Fluxor is a zero boilerplate Flux/Redux library for Microsoft .NET and Blazor.
MIT License
1.24k stars 141 forks source link

IEffect in a middleware namespace is still automatically registered #278

Closed hillin closed 2 years ago

hillin commented 2 years ago

The intention of the following code snippet, if I understand correctly, an IEffect (as well as other auto-registerable types) that is placed under the namespace where a middleware resides will be excluded in the types to be automatically registered: https://github.com/mrpmorris/Fluxor/blob/65a96b579af82387ddddacb50d7c76a3b6b3b377/Source/Fluxor/DependencyInjection/ReflectionScanner.cs#L92-L107

However from the implementation of AssemblyScanSettings.FilterClasses below we can see they are not effectively excluded: https://github.com/mrpmorris/Fluxor/blob/65a96b579af82387ddddacb50d7c76a3b6b3b377/Source/Fluxor/DependencyInjection/AssemblyScanSettings.cs#L29-L37

I think the || in line 36 should be &&.

hillin commented 2 years ago

(Background: we are writing a middleware and wish that some of the effect classes used by the middleware are not automatically registered by Fluxor, rather let the middleware to control them).

mrpmorris commented 2 years ago

I'm unable to reproduce this.

The exclusion works on namespace. Is the namespace of the effect either the same or a sub of the namespace the middleware is in?

mrpmorris commented 2 years ago

Can you provide a repro for this?

mrpmorris commented 2 years ago

I'll close this for now. If you manage to create a repro then please post a link to it and I'll reopen.