core icon indicating copy to clipboard operation
core copied to clipboard

Get services from http context

Open rbauduin opened this issue 4 years ago • 1 comments

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 .

rbauduin avatar Aug 07 '21 12:08 rbauduin

@Jand42 is net50 the right branch for this? Shouldn't we be on websharper50 instead?

granicz avatar Aug 19 '21 23:08 granicz

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

Jand42 avatar Oct 27 '22 09:10 Jand42