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

EventTypeMapper always scan assemblies #182

Closed
GKotfis opened this issue Nov 25, 2022 · 1 comment
Closed

EventTypeMapper always scan assemblies #182

GKotfis opened this issue Nov 25, 2022 · 1 comment

Comments

@GKotfis
Copy link

GKotfis commented Nov 25, 2022

public static Type? ToType(string eventTypeName) => Instance.typeMap.GetOrAdd(eventTypeName, _ =>

I just want to ask why ToType(string eventTypeName) first scan assemblies to look for a type and then add it to type map? Why not vice versa? So first, we look for cached type in typeNameMapand If not exists, we scan assemblies. Is it for purpose?

@GKotfis
Copy link
Author

GKotfis commented Nov 25, 2022

I'm dumb! Just read the code one more time ... GetOrAdd 🤦‍♂️

@GKotfis GKotfis closed this as completed Nov 25, 2022
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

1 participant