relativitydev / Gravity

ORM Framework for Relativity Custom Development
Other
16 stars 10 forks source link

Use HashSet or flags for choices #101

Open Arithmomaniac opened 6 years ago

Arithmomaniac commented 6 years ago

Right now, a choice list is a List<T>. This doesn't ensure that the selected choices are unique, and could lead to strange behavior and/or failed API calls if a choice is added to the list multiple times.

We should use either flag enums instead (and then the choice list can just be of type T), or the choice list should be a HashSet<T> instead.

I favor using HashSet.

Arithmomaniac commented 6 years ago

We could also just ensure people could use whatever ICollection<T> they want - which would not be a breaking change after all.