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

Add [Calculated] attribute to denote properties to ignore #42

Open
carusology opened this issue Feb 9, 2018 · 1 comment
Open

Add [Calculated] attribute to denote properties to ignore #42

carusology opened this issue Feb 9, 2018 · 1 comment

Comments

@carusology
Copy link
Contributor

Background

There may be properties on the ImmutableBase<TImmutable> that are not storing relevant data, but instead represent a local caches or syntactic sugar that should actually be ignored when determining the immutable value object's equality, hash code, or string representation.

We should create a [Calculated] attribute that we have consumers flag these properties with so the ImmutableBase<TImmutable> can ignore them.

Task

Add a [Caculated] attribute that ImmutableBase<TImmutable> will look for on all of its child properties and, when found, ignore that property for the purposes of setting it, determining equality, hash code, or string representation. It could, however, be potentially fetched via the GetPropertyValueImpl method.

@carusology
Copy link
Contributor Author

carusology commented Feb 9, 2018

Not sure on the name here. I've seen an example of a cache, which [Calculated] doesn't quite fit with. However, the cache probably didn't belong on the immutable value object to begin with, but instead on the service that the cached object came from, so it may be irrelevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant