diff --git a/MP.Data/DatabaseModels/AnagArticoli.cs b/MP.Data/DatabaseModels/AnagArticoli.cs new file mode 100644 index 00000000..0480a0bb --- /dev/null +++ b/MP.Data/DatabaseModels/AnagArticoli.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class AnagArticoli + { + #region Public Properties + + public string CodArticolo { get; set; } + public string DescArticolo { get; set; } + public string Disegno { get; set; } + public string Tipo { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.Data/DatabaseModels/Macchine.cs b/MP.Data/DatabaseModels/Macchine.cs new file mode 100644 index 00000000..f9469bb1 --- /dev/null +++ b/MP.Data/DatabaseModels/Macchine.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +#nullable disable + +namespace MP.Data.DatabaseModels +{ + public partial class Macchine + { + #region Public Properties + + public string CodMacchina { get; set; } + public string Descrizione { get; set; } + public string IdxMacchina { get; set; } + public string Nome { get; set; } + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/MP.Data/MoonPro_STATSContext.cs b/MP.Data/MoonPro_STATSContext.cs index f7e26640..6a821592 100644 --- a/MP.Data/MoonPro_STATSContext.cs +++ b/MP.Data/MoonPro_STATSContext.cs @@ -35,9 +35,11 @@ namespace MP.Data #region Public Properties + public virtual DbSet DbSetArticoli { get; set; } public virtual DbSet DbSetAzioniUL { get; set; } public virtual DbSet DbSetControlli { get; set; } public virtual DbSet DbSetDdbTurni { get; set; } + public virtual DbSet DbSetMacchine { get; set; } public virtual DbSet DbSetODL { get; set; } public virtual DbSet DbSetScarti { get; set; } public virtual DbSet DbSetUserLog { get; set; } @@ -66,6 +68,45 @@ namespace MP.Data protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS"); + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_UI_AnagArticoli"); + + entity.Property(e => e.CodArticolo) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.DescArticolo) + .IsRequired() + .HasMaxLength(250); + + entity.Property(e => e.Disegno) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Tipo) + .IsRequired() + .HasMaxLength(50); + }); + + modelBuilder.Entity(entity => + { + entity.HasNoKey(); + + entity.ToView("v_UI_Macchine"); + + entity.Property(e => e.CodMacchina).HasMaxLength(50); + + entity.Property(e => e.Descrizione).HasMaxLength(50); + + entity.Property(e => e.IdxMacchina) + .IsRequired() + .HasMaxLength(50); + + entity.Property(e => e.Nome).HasMaxLength(50); + }); modelBuilder.Entity(entity => {