Skip to content
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

create server-side SiteService #3803

Merged
merged 1 commit into from
Feb 15, 2024
Merged

create server-side SiteService #3803

merged 1 commit into from
Feb 15, 2024

Conversation

sbwalker
Copy link
Member

No description provided.

@sbwalker sbwalker merged commit 8013716 into oqtane:dev Feb 15, 2024
@sbwalker
Copy link
Member Author

sbwalker commented Feb 15, 2024

  • 2 different implementations of ISiteService interface (interface cannot change as modules rely on it)
  • client implementation registered in client project Program.cs
  • server implementation registered in server project Startup.cs
  • logic from SiteController migrated to SiteService (SiteController becomes a thin API endpoint)
  • HttpContextAccessor used to obtain HttpContext within SiteService
  • authorization attributes need to have equivalent IsInRole() calls added to SiteService methods to ensure consistent security enforcement on server and client
  • HttpContext.Response.StatusCode logic needs to remain in Controller
  • Controller methods changed to asynchronous
  • some Controller methods need to be refactored to integrate with results returned from SiteService
  • caching migrated to SiteService so that calls originating on server will also get performance benefit
  • SiteService uses Task.Run() to execute Repository methods - this is not optimal however there is significant effort to introduce a full set of new Repository async methods (the sync methods need to be retained as existing modules rely on them). Task.Run() should exhibit same performance characteristics as legacy approach as Repository has always been synchronous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant