core
core copied to clipboard
Get services from http context
From a discussion on Gitter it appears that the services made available through "WebSharper.AspNetCore.Services" don't include the scoped services because they are taken from the WebSharperOptions instance. This change fixes the code and services are now taken from the HttpContext, implementing the workaround indicated by @Tarmil .
@Jand42 is net50 the right branch for this? Shouldn't we be on websharper50 instead?
Closing this, as this no longer apply. To avoid confusion, the "WebSharper.AspNetCore.Services" key has been removed as part of #1213.
Access ANC Services through the HttpContext object, which can be obtained from a WebSharper.Web.Context by the extension method .HttpContext, source:
https://github.com/dotnet-websharper/core/blob/master/src/sitelets/WebSharper.AspNetCore/WebContextExtensions.fs#L31