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
[WIP] Implementing Geography types #58
Conversation
double arrayIndexOne = (double)arrayValues[0]; | ||
double arrayIndexTwo = (double)arrayValues[1]; | ||
|
||
positions.PositionsArray = new double[] { arrayIndexOne, arrayIndexTwo }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should prefer to use the Positions
constructors whenever possible (rather than assign directly to PositionsArray
), since we may be implementing logic to e.g. restrict the number of input elements in the array, etc.
In fact we may just want to make PositionsArray { get; private set; }
to enforce that.
{ | ||
return new Positions(arrayValues); | ||
} | ||
throw new Exception("Value should be 2 or 3"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to make this decision (with the array length, throwing exceptions, etc.) inside the Positions
class, to keep the logic all in one place - since we'll want to make the same decision whether we are reading JSON or just using the Positions
class directly.
Closing this old PR, not being worked on. |
PR to track work in progress
This will close #38