StilauGamer
Explore posts from serversInject IDbContextFactory or DbContext directly?
Hey,
I was working with a project earlier that I've made and I saw I was injecting the db context with
IDbContextFactory<ApplicationDbContext>
and then manually creating a db context every time I was going to use it.
I was doing this:
await using var dbContext = await _dbContextFactory.CreateDbContextAsync();
I read somewhere that you should just inject the DB Context directly, and let the DI handle the lifetime of it, but I was unsure if this was bs or not?
Does anyone have any tips surrounding this?
Thanks 🙂15 replies
Cookie not set when returning from OAuth callback
Hey!
So I currently have a API route as the callback when the discord oauth has been completed and is callbacking to my website..
In there I make a JWT token that I want to set as a cookie, and that works.
But the issue I am having is that when I redirect to the main page
/
.
So when I come back to the /
page I need to refresh for the vue component to detect the cookie.
I simply do:
And this returns undefined when I first get redirected from the callback.
But gives me the cookie when I refresh?
How can I fix this?2 replies
Localstorage + JWT
Hello!
So I am currently working on a project where I want to store a JWT Token in localstorage...
But I am having some issues finding out how I can use it?
Is there a better way than storing it in the localstorage, and how would I store it in the localstorage?
15 replies
UniTask VS Task
Idk if this is the correct place to ask, but I am modding for some Unity games and one of the frameworks there is utilizing UniTask.
What does that benefit from using Task? Should I use UniTask when working with shit I want to await, etc?
I cannot find any good examples on the differences between them, so I figured I'd ask here lol
1 replies
Discord.Net + MagicOnion, heheh
Hey!
So I am working on a discord bot that I want to intergrate into a server using websockets, I found MagicOnion and wanted to test it out, but I can only find documentation to how to use it with Asp.Net.
Does anyone know how I would implement it with Discord.Net?
I have a test service that uses the
ServiceBase<>
and IService<>
This is my current code for my bot:
137 replies