Ao tentar adicionar uma Migration, ele dá o seguinte erro: The current CSharpHelper cannot scaffold literals of type 'Microsoft.EntityFrameworkCore.Metadata.Internal.DirectConstructorBinding'. Configure your services to use one that can.
public class ApplicationContext : DbContext
{
public ApplicationContext(DbContextOptions options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<Produto>().HasKey(t => t.Id);
}
}
string connectionString = Configuration.GetConnectionString("Default");
services.AddDbContext<ApplicationContext>(options =>
options.UseSqlServer(connectionString)
);
"ConnectionStrings": {
"Default": "Data Source=(localdb)\\ProjectsV13;Initial Catalog=CasaDoCodigo;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"
}