50d65eebaa
- renaming classi gestione DbModels in - spostamento anagrafica flussi da auth a generale
118 lines
3.7 KiB
C#
118 lines
3.7 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.Extensions.Configuration;
|
|
using MP.Data.DbModels;
|
|
using NLog;
|
|
|
|
#nullable disable
|
|
// <Auto-Generated>
|
|
// This is here so CodeMaid doesn't reorganize this document
|
|
// </Auto-Generated>
|
|
namespace MP.Data
|
|
{
|
|
public partial class MoonPro_InveContext : DbContext
|
|
{
|
|
#region Private Fields
|
|
|
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
|
|
private IConfiguration _configuration;
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Public Constructors
|
|
|
|
/// <summary>
|
|
/// Indispensabile x prima generazione migrations EFCore
|
|
/// </summary>
|
|
|
|
[Obsolete("This constructor should never be used directly, and is only needed to generate entityframework stuff. Connection string can be adapted as pleased.")]
|
|
public MoonPro_InveContext()
|
|
{
|
|
}
|
|
|
|
public MoonPro_InveContext(IConfiguration configuration)
|
|
{
|
|
_configuration = configuration;
|
|
}
|
|
|
|
public MoonPro_InveContext(DbContextOptions<MoonPro_InveContext> options) : base(options)
|
|
{
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Properties
|
|
|
|
#region PER INVE
|
|
|
|
public virtual DbSet<AnagMagModel> DbAnagMag { get; set; }
|
|
public virtual DbSet<InventorySessionModel> DbInveSess { get; set; }
|
|
public virtual DbSet<ScanDataModel> DbScanData { get; set; }
|
|
public virtual DbSet<AnagUdcModel> DbUdcData { get; set; }
|
|
public virtual DbSet<AnagLottoModel> DbLottoData { get; set; }
|
|
public virtual DbSet<AnagArticoli_MAG> DbArtMag { get; set; }
|
|
public virtual DbSet<AnagLottiArca> DbLottoArca { get; set; }
|
|
public virtual DbSet<InveSessTotLotModel> DbTotLotti { get; set; }
|
|
public virtual DbSet<VExpInveSession> DbExpSessione { get; set; }
|
|
#endregion PER INVE
|
|
|
|
#region PER SPEC
|
|
|
|
public virtual DbSet<AnagGiacenzeModel> DbGiacenzeData { get; set; }
|
|
|
|
#endregion PER SPEC
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Private Methods
|
|
|
|
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
|
|
|
#endregion Private Methods
|
|
|
|
#region Protected Methods
|
|
|
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
{
|
|
if (!optionsBuilder.IsConfigured)
|
|
{
|
|
string connString = _configuration.GetConnectionString("MP.Inve");
|
|
if (!string.IsNullOrEmpty(connString))
|
|
{
|
|
optionsBuilder.UseSqlServer(connString);
|
|
}
|
|
else
|
|
{
|
|
optionsBuilder.UseSqlServer("Server=SQL2016DEV;Database=MoonPro_MAG;Trusted_Connection=True;");
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
modelBuilder.HasAnnotation("Relational:Collation", "SQL_Latin1_General_CP1_CI_AS");
|
|
modelBuilder.Entity<VExpInveSession>(entity =>
|
|
{
|
|
entity.HasNoKey();
|
|
|
|
entity.ToView("v_Exp_InveSession");
|
|
|
|
//entity.Property(e => e.DtEnd).HasColumnType("datetime");
|
|
|
|
//entity.Property(e => e.DtStart).HasColumnType("datetime");
|
|
|
|
//entity.Property(e => e.InveSessId).HasColumnName("InveSessID");
|
|
|
|
entity.Property(e => e.Qty).HasColumnType("decimal(18, 6)");
|
|
|
|
entity.Property(e => e.ScanId).HasColumnName("ScanID");
|
|
});
|
|
|
|
OnModelCreatingPartial(modelBuilder);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |