1
I’m most likely not able to connect my application to my database with Entity Framework Core, as this error keeps popping up whose I can’t decipher.
I have already researched the documentation and tried to do several things.
In addition, I also can’t work with Entity Framework mapping my model, as a message appears saying that user and server credentials are missing.
Source Code:
public AgendaContext() : base()
{
}
protected override void OnConfiguring (DbContextOptionsBuilder builder)
{
builder.UseMySQL("server=localhost;database=trabalho;user=root;password=123456789");
}
protected override void OnModelCreating(ModelBuilder builder)
{
builder.Entity<Agenda>()
.ToTable("tb_agenda");
builder.Entity<Agenda>()
.HasKey(p => p.AgendaID);
builder.Entity<Agenda>()
.Property(p => p.Nome)
.HasColumnType("varchar(80)");
builder.Entity<Agenda>()
.Property(p => p.Endereco)
.HasColumnType("varchar(255)");
builder.Entity<Agenda>()
.Property(p => p.DiaCompromisso)
.HasColumnType("date");
builder.Entity<Agenda>()
.Property(p => p.HoraCompromisso)
.HasColumnType("time");
builder.Entity<Agenda>()
.Property(p => p.Final)
.HasColumnType("time");
}
public DbSet<Agenda> Agenda { get; set; }
Error:
System.Typeloadexception: 'get_Info method on type MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension from Assembly Mysql.Data.Entityframeworkcore, Version=8.0.18.0, Culture=neutral, Publickeytoken=c5687fc88969c44d does not have a implementation.'
Thank you, however, the code that was posted, I put where?
– Gustavo Oliveira
@Gustavooliveira but you no longer have Startup code in your project?
– Guilherme Nascimento
Startup no, but I put the codes directly in Dbcontext, because I don’t know much. Also, I tried to put in the starting point of my program and it did not work....
– Gustavo Oliveira
Because I’m using Entity Framework Core on. Net Framework, IE, I’m using a Windows Forms application, so I’m not able to make the connection...
– Gustavo Oliveira