You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I wanted a generic implementation of sessionStorage that also supports server side Blazor. I thought I could easily generate that myself, as follows:
The generated implementation, in SessionStorageService.g.cs, doesn't contain a using Microsoft.JSInterop; statement, so it doesn't work in another namespace.
The FromJson extension method doesn't work on ValueTask<string>, so the currently generated code doesn't work.
(Specifically in the implementation of GetItemAsync:
As an additional note, I'd personally prefer if it wasn't required to add the FromJson and ToJson methods as extension methods to use the generic interop, as those methods now show up in the Intellisense of every object in my project (using Resharper).
Thanks for your help, and your work on this project!
The text was updated successfully, but these errors were encountered:
Hi, this looks very nice!
However, I wanted a generic implementation of sessionStorage that also supports server side Blazor. I thought I could easily generate that myself, as follows:
That almost works, except for two things:
SessionStorageService.g.cs
, doesn't contain ausing Microsoft.JSInterop;
statement, so it doesn't work in another namespace.FromJson
extension method doesn't work onValueTask<string>
, so the currently generated code doesn't work.(Specifically in the implementation of GetItemAsync:
As an additional note, I'd personally prefer if it wasn't required to add the FromJson and ToJson methods as extension methods to use the generic interop, as those methods now show up in the Intellisense of every object in my project (using Resharper).
Thanks for your help, and your work on this project!
The text was updated successfully, but these errors were encountered: