-
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
Add IUserTimeZoneService to make it easier to mock UserTimeZoneService #16614
Conversation
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.
Additionally, add this change to the list of breaking changes in 2.0.
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/IUserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/IUserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/IUserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
Renaming the methods will be a breaking changes |
Introducing the interface is already a breaking change :) |
It doesn't break anything, anyhow I agree with your suggestions, @deanmarcussen if you don't have any objection I will react to @MikeAlhayek changes |
@hishamco You are no longer registering the service directly. So now anyone that is injecting that service directly will be broken. you can instead do this to avoid this breaking change
Then add Either way, an interface should be little more generic. So since you are introducing an interface, I rather have a cleaner contract |
While |
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.
Please wait, I want to understand more about the issue first
@hishamco we triaged this today. @sebastienros @gvkries and myself agreed with my change request. Please make the requested changed and ping me again. |
@MikeAlhayek does this mean any service we have should have an interface for extensibility? |
I don't think we should just blindly start creating interfaces because we want to abstract everything. Ideally, this kind of service will be internal so they are not exposed. But, when we decide we need an interface, preferable we would add a reusable interface without including any implementation info. For example, in this case we want UserTimeZone not CurrentUserTimeZone. So the interface would look either
or
This way we do not repeat the context. In this case, I think we should use |
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.
@hishamco not exactly
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/IUserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/IUserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/IUserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Extensions/UserTimeZoneServiceExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Extensions/UserTimeZoneServiceExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Extensions/UserTimeZoneServiceExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Extensions/UserTimeZoneServiceExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Extensions/UserTimeZoneServiceExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Extensions/UserTimeZoneServiceExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/Extensions/UserTimeZoneServiceExtensions.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Show resolved
Hide resolved
@hishamco are you planning to finalize this soon as part of 2.0 or should we push this out to 3.0? |
@MikeAlhayek I just removed the extension methods, for now, we are ready to ship this |
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Mike Alhayek <mike@crestapps.com>
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.
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneSelector.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Users/TimeZone/Services/UserTimeZoneService.cs
Outdated
Show resolved
Hide resolved
…erTimeZoneSelector.cs Co-authored-by: Mike Alhayek <mike@crestapps.com>
@MikeAlhayek please check the changes before suggest code change, seems the build is broken |
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.
@hishamco feel free to merge if you good with my last changs.
Fixes #16613