30 lines
848 B
C#
30 lines
848 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ApiPolo.Models.VT_dbcontext
|
|
{
|
|
public class VT_ARTICOLI_TABLE_DbContext : DbContext
|
|
{
|
|
|
|
public DbSet<Articoli> Articoli { get; set; }
|
|
|
|
|
|
public VT_ARTICOLI_TABLE_DbContext(DbContextOptions<VT_ARTICOLI_TABLE_DbContext> options) : base(options)
|
|
{
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.Entity<Articoli>().ToTable("ARTICOLI");
|
|
modelBuilder.Entity<Articoli>().HasKey(Table => new
|
|
{
|
|
Table.Azienda,
|
|
Table.SlCodice
|
|
}); // Definizione della chiave primaria composta
|
|
//base.OnModelCreating(modelBuilder);
|
|
}
|
|
}
|
|
|
|
}
|