Skip to content
New issue

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

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

Already on GitHub? # to your account

Add ability to exclude certain types from selector #67

Open
sm-g opened this issue Sep 29, 2020 · 2 comments
Open

Add ability to exclude certain types from selector #67

sm-g opened this issue Sep 29, 2020 · 2 comments

Comments

@sm-g
Copy link

sm-g commented Sep 29, 2020

I want to write something like

Types.InAssembly(Assembly)
.That()
.AreNot(typeof(Foo), typeof(Bar))

instead of

var exceptions = new[]
            {
                typeof(Foo),
                typeof(Bar),
            };
Types.InAssembly(Assembly)
.That()
.DoNotHaveNameMatching(string.Join('|', exceptions.Select(t => t.Name)))

The last solution is invalid, because it also excludes nested types Bar.Foo and types from other namespace with same names.

@Prikalel
Copy link

Prikalel commented Aug 21, 2023

Plus it would be cool if there was a solution to create Types instance from the list of TypeDefinitions.
UPD: add it also will be very cool to have some internal useful code available for example

public static TypeDefinition ToTypeDefinition(this Type type)

@Prikalel
Copy link

Prikalel commented Aug 24, 2023

and it also will be very cool to have some internal useful code available

    public static Type ToType(this TypeDefinition typeDefinition)

NeVeSpl added a commit to NeVeSpl/NetArchTest.eNhancedEdition that referenced this issue Nov 23, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants