❔ how to use EF6 in library with no dependancy injection and no startup.cs
I used EF core power tools to generate DB Context and reverse engineer the models.
now I get an error:
System.InvalidOperationException
HResult=0x80131509
Message=No database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.
Source=Microsoft.EntityFrameworkCore
all the answers I can find are doing something in startup.cs which i dont have or using the dependancy injection framework which i dont use either
all the answers I can find are doing something in startup.cs which i dont have or using the dependancy injection framework which i dont use either
P
PatrickG•393d ago
holy shit i actually figured it out I added this to my context
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer("myconnstring");
}
A
Accord•392d ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
51KMembers
View on DiscordWant results from more Discord servers?
More Posts❔ HeadFirst Design PatternSo I started with this Book today. First problem starts with the Duck Project:
and when he tests h✅ EqualityComparerHello, anyone know of this code work ?
--> `EqualityComparer<ICollection<myclass>> .Default.Equals❔ error attaching script (unity)this error appears when trying to attach the script, does anyone know how to solve it?❔ i have an app that runs well on my pc but not on other pcsi have an app that runs well on my pc but on when i zip it and bring it to another pc the ui is all yield???```cs
public IEnumerable<int> A()
{
for (int i = 0; i <= 10; i += 2)
yield return i;
}
C# Data Table issuehttps://pastebin.com/DSHwSh0M
based on this program, I need to set the values of the `Old PS A11Y S