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