-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Obsolete ILocalClock.LocalNowAsync #16752
Conversation
src/OrchardCore/OrchardCore.Abstractions/Modules/Services/ILocalClock.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore/OrchardCore.Abstractions/Modules/Services/ILocalClock.cs
Outdated
Show resolved
Hide resolved
/// <summary> | ||
/// Gets the time for the local time zone. | ||
/// </summary> | ||
Task<DateTimeOffset> LocalNowAsync { get; } | ||
|
||
Task<DateTimeOffset> GetLocalNowAsync(); |
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.
This introduces a breaking change. To avoid having a breaking change so this instead
Task<DateTimeOffset> LocalNowAsync { get; }
Task<DateTimeOffset> GetLocalNowAsync()
=> LocalNowAsync ;
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.
Why it's a breaking change? the value still comes from the new implementation, right?
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.
It's for when you have an existing alternative implementation. Should be rare but can happen: Then, with Mike's code, no change is needed, only when we remove LocalNowAsync
.
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.
That's why I used error before to let the compiler complains whenever we use it
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.
That's why I used error before to let the compiler complains whenever we use it
this will break people. So we have to avoid it. Doing my suggestion then no breaking change because in the interface we provide the default implementation. In your implementation, you can change the default behavior found in the interface.
|
…alClock.cs Co-authored-by: Zoltán Lehóczky <[email protected]>
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.
Fixed the build
Fixes #16751
I'm not sure why we added an
async
property which was the first time I saw it in my life. @rjpowers10 could you please try to reproduce in this PR