fluid icon indicating copy to clipboard operation
fluid copied to clipboard

Blacklist members on models

Open twgraham opened this issue 6 years ago • 3 comments

Using Register<Model> is extremely convenient when registering my template models, however there are some circumstances where I don't want specific model members to be accessible. Currently my only option is to register the names of all the specific members I want (whitelist). It would be great if I could instead select members that I don't want (blacklist).

One convenient way of doing this would be marking my members with an opt-out attribute, something like [FluidIgnore].

Happy to make a PR on this.

twgraham avatar May 24 '19 00:05 twgraham

The only caveat with attributes is that your model has a dependency on Fluid. If you are fine with that, that's good, or we could have an overload of Register<T> that would accept a list of properties that should be ignored.

sebastienros avatar May 24 '19 01:05 sebastienros

Any updates on this?

hishamco avatar Oct 27 '21 17:10 hishamco

Maybe Jint's MemberFilter predicate could work here too?

lahma avatar Oct 27 '21 17:10 lahma