using Microsoft.EntityFrameworkCore; namespace ApiPolo.Models.VT_dbcontext { public class VT_MAGAZZINI_DbContext :DbContext { public DbSet Magazzini { get; set; } public VT_MAGAZZINI_DbContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity().ToTable("MAGAZZINI"); modelBuilder.Entity().HasKey(Table => new { Table.Azienda, Table.Mgcodmag }); // Definizione della chiave primaria composta //base.OnModelCreating(modelBuilder); } } }