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

RequiredIf rule suddenly requiring full namespace #209

Open
ssteiner opened this issue Mar 9, 2021 · 0 comments
Open

RequiredIf rule suddenly requiring full namespace #209

ssteiner opened this issue Mar 9, 2021 · 0 comments

Comments

@ssteiner
Copy link

ssteiner commented Mar 9, 2021

We've been using ExpressiveAnnotations for a while now to validate data in our backend models and for an MVC FE.

We can't quite put the finger on when this started happening (it's a rather infrequently used model), but all of a sudden, we're getting expressions from some of our RequiredIf tags. The issue is that an enum type exists in two namespaces. That's easily fixed by prefixing the namespace, yet that now causes issues in our new FE (we're translating the Expressive Annotations syntax into the syntax required by our new FE- the new FE is not C# so it's not namespace aware).

What I don't quite get... the library that contains our models, it's self-contained with zero dependencies. The using statements in the class that causes problems just includes ExpressiveAnnotations.Attributes and System.ComponentModel.DataAnnotations.

Why would ExpressiveAnnotations perform a global type search and not just look at what the project that makes use of the the data annotations?

the context of our solution is 60+ projects, that means a ton of namespaces and types. Shouldn't a type search be more contrained and only check the current namespace plus perhaps whatever's included in the class at hand (using the using statements)?

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