Trying to setup SQLite with EntityFramework (Discord Bot /w DSharpPlus)
I'm trying to setup SQLite for my discord bot, and to start the DB file, I tried using this command
LloydContext
is my class that inherits DbContext
. However, this command just builds my bot then runs it then gives an exception saying it cant find my service.
10 Replies
This is how I start the service (According to what I found with the DSharpPlus documentation
I have never done anything like this, so I'm very lost. I tried following tutorials on the DSharpPlus documentation (Even their example bots), but it didn't help too much.
Both Entity Framework Core and Entity Framework 6 are installedStart by deleting EF6
EF6 runs on modern .NET?
i removed all packages related to EF6, and now it's just running my bot and doing nothing within the package manager console. It's been open for ~5 minutes.
@oke https://learn.microsoft.com/en-us/ef/core/cli/dbcontext-creation?tabs=dotnet-core-cli i think is what you're looking for
Design-time DbContext Creation - EF Core
Strategies for creating a design-time DbContext with Entity Framework Core
right as i said that, it threw an exception
i'd use the design-time factory option
From application services is the most ideal option though.
i dont know what that means
look at my link
i did, but i still dont know what to do
ive never dealt with services before and i dont know how to use that with dsharpplus