JasonBock / SpackleNet

Spackle is a project that contains a number of helper methods I've used to supplement the core classes in .NET.
MIT License
14 stars 1 forks source link

Create a ValidRange class, extending Range #1

Closed JasonBock closed 8 years ago

JasonBock commented 10 years ago

Right now if I do this:

var range = new Range<int>(5, 2);

That works, the object just sets Start to 2, and End to 5. There are cases where we want a validated range - that is, start should be less than or equal to end, and throw an exception otherwise.

Therefore: ◾Unseal Range ◾Create ValidRange that inherits from Range and adds that validation in the constructor.

JasonBock commented 8 years ago

I'm closing this. Don't see a reason to add it.