Podczas polecenia update-database pojawia się następujący błąd:
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - Łańcuch certyfikatów został wystawiony przez urząd, którego nie jest zaufany.)
Będę wdzięczny za pomoc w rozwiązaniu tego problemu. Oto kod:
using Microsoft.EntityFrameworkCore;
namespace RestaurantAPI.Entities
{
public class RestaurantDbContext : DbContext
{
private string _connectionString = "Server=KAMIL;Database=RestaurantDb;Trusted_Connection=True;Encrypt=True;TrustServerCertificate=False;";
public DbSet<Restaurant> Restaurants { get; set; }
public DbSet<Address> Addresses { get; set; }
public DbSet<Dish> Dishes { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Restaurant>()
.Property(r => r.Name)
.IsRequired()
.HasMaxLength(25);
modelBuilder.Entity<Dish>()
.Property(d => d.Name)
.IsRequired();
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(_connectionString);
}
}
}