-
Notifications
You must be signed in to change notification settings - Fork 663
TimeSpan-Style TimeDuration Constructors in C# Bindings #2778
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
TimeSpan-Style TimeDuration Constructors in C# Bindings #2778
Conversation
… user familiarity.
|
Thank you for submitting this! We'll work on getting it reviewed soon. |
|
Thanks! Feel free to merge as-is if you have no problems with it on review. Also very happy to add the equivalent construction helper methods to the |
|
Hello! Just wanted to bump this as it's been a couple months now on what seems like a fairly minor edit. :) |
rekhoff
left a comment
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.
These changes look reasonable and and clear.
|
I'm going to force-merge this since the only CI checks that haven't run/passed are from the public repos that we merged in. This PR is from before we merged them, so it can't mess them up. |
Description of Changes
This change adds the following
System.TimeSpan-style static construction methods toSpacetimeDB.TimeDuration:static TimeDuration FromMilliseconds(double milliseconds)static TimeDuration FromSeconds(double seconds)static TimeDuration FromMinutes(double minutes)static TimeDuration FromHours(double hours)static TimeDuration FromDays(double days)These mirror the equivalently named static methods on
System.TimeSpanand dramatically improve usability and familiarity for experienced C# users with no more overhead than the user performing the multiplication themselves.Wish I'd thought to do this before v1.1.2 got released. Ah well.
API and ABI breaking changes
None. Convenience methods added in bindings only.
Expected complexity level and risk
1 (potentially up to a low 2 if cleanup is desired elsewhere in the bindings to leverage these new methods).
Testing