Completata review modello dati iniziale
This commit is contained in:
@@ -13,9 +13,9 @@ namespace GPW.CORE.Data.DbModels
|
||||
{
|
||||
public DipendentiModel()
|
||||
{
|
||||
RegAttivitaNav = new HashSet<RegAttivitum>();
|
||||
RilievoTempNav = new HashSet<RilievoTemp>();
|
||||
TimbratureNav = new HashSet<Timbrature>();
|
||||
RegAttivitaNav = new HashSet<RegAttivitaModel>();
|
||||
RilievoTempNav = new HashSet<RilievoTempModel>();
|
||||
TimbratureNav = new HashSet<TimbratureModel>();
|
||||
}
|
||||
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@@ -52,8 +52,8 @@ namespace GPW.CORE.Data.DbModels
|
||||
public DateTime? DataCessazione { get; set; }
|
||||
public bool? Attivo { get; set; }
|
||||
|
||||
public virtual ICollection<RegAttivitum> RegAttivitaNav { get; set; }
|
||||
public virtual ICollection<RilievoTemp> RilievoTempNav { get; set; }
|
||||
public virtual ICollection<Timbrature> TimbratureNav { get; set; }
|
||||
public virtual ICollection<RegAttivitaModel> RegAttivitaNav { get; set; }
|
||||
public virtual ICollection<RilievoTempModel> RilievoTempNav { get; set; }
|
||||
public virtual ICollection<TimbratureModel> TimbratureNav { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
+13
-2
@@ -1,10 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace GPW.CORE.Data.DbModels
|
||||
{
|
||||
public partial class RegAttivitum
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("RegAttivita")]
|
||||
public partial class RegAttivitaModel
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public int IdxRa { get; set; }
|
||||
public int IdxDipendente { get; set; }
|
||||
public int IdxFase { get; set; }
|
||||
@@ -17,6 +24,10 @@ namespace GPW.CORE.Data.DbModels
|
||||
public decimal? OreTot { get; set; }
|
||||
public decimal? Importo { get; set; }
|
||||
|
||||
public virtual DipendentiModel IdxDipendenteNavigation { get; set; } = null!;
|
||||
/// <summary>
|
||||
/// Navigation property to Dipendente
|
||||
/// </summary>
|
||||
[ForeignKey("IdxDipendente")]
|
||||
public virtual DipendentiModel DipNav { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GPW.CORE.Data.DbModels
|
||||
{
|
||||
public partial class RilievoTemp
|
||||
{
|
||||
public int IdxDipendente { get; set; }
|
||||
public DateTime DtRilievo { get; set; }
|
||||
public decimal TempRil { get; set; }
|
||||
|
||||
public virtual DipendentiModel IdxDipendenteNavigation { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace GPW.CORE.Data.DbModels
|
||||
{
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("RilievoTemp")]
|
||||
public partial class RilievoTempModel
|
||||
{
|
||||
public int IdxDipendente { get; set; }
|
||||
public DateTime DtRilievo { get; set; }
|
||||
public decimal TempRil { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Navigation property to Dipendente
|
||||
/// </summary>
|
||||
[ForeignKey("IdxDipendente")]
|
||||
public virtual DipendentiModel DipNav { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace GPW.CORE.Data.DbModels
|
||||
{
|
||||
public partial class Timbrature
|
||||
// <Auto-Generated>
|
||||
// This is here so CodeMaid doesn't reorganize this document
|
||||
// </Auto-Generated>
|
||||
[Table("Timbrature")]
|
||||
public partial class TimbratureModel
|
||||
{
|
||||
public DateTime DataOra { get; set; }
|
||||
public int IdxDipendente { get; set; }
|
||||
@@ -15,6 +20,10 @@ namespace GPW.CORE.Data.DbModels
|
||||
/// </summary>
|
||||
public bool? Approv { get; set; }
|
||||
|
||||
public virtual DipendentiModel IdxDipendenteNavigation { get; set; } = null!;
|
||||
/// <summary>
|
||||
/// Navigation property to Dipendente
|
||||
/// </summary>
|
||||
[ForeignKey("IdxDipendente")]
|
||||
public virtual DipendentiModel DipNav { get; set; } = null!;
|
||||
}
|
||||
}
|
||||
@@ -39,9 +39,9 @@ namespace GPW.CORE.Data
|
||||
|
||||
public virtual DbSet<CheckVc19Model> DbSetCheckVc19 { get; set; } = null!;
|
||||
public virtual DbSet<DipendentiModel> DbSetDipendenti { get; set; } = null!;
|
||||
public virtual DbSet<RegAttivitum> DbSetRegAttivita { get; set; } = null!;
|
||||
public virtual DbSet<RilievoTemp> DbSetRilievoTemp { get; set; } = null!;
|
||||
public virtual DbSet<Timbrature> DbSetTimbrature { get; set; } = null!;
|
||||
public virtual DbSet<RegAttivitaModel> DbSetRegAttivita { get; set; } = null!;
|
||||
public virtual DbSet<RilievoTempModel> DbSetRilievoTemp { get; set; } = null!;
|
||||
public virtual DbSet<TimbratureModel> DbSetTimbrature { get; set; } = null!;
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
@@ -222,10 +222,8 @@ namespace GPW.CORE.Data
|
||||
.HasColumnName("WOL_MAC");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RegAttivitum>(entity =>
|
||||
modelBuilder.Entity<RegAttivitaModel>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdxRa);
|
||||
|
||||
entity.HasIndex(e => e.Inizio, "ix_RA_inizio");
|
||||
|
||||
entity.HasIndex(e => new { e.IdxDipendente, e.Inizio }, "ix_idxDip");
|
||||
@@ -264,19 +262,17 @@ namespace GPW.CORE.Data
|
||||
.HasComputedColumnSql("(CONVERT([decimal](19,4),CONVERT([decimal](19,4),datediff(minute,isnull([inizio],'19000101'),isnull([fine],'19000101')),(0))/(60),(0)))", false)
|
||||
.HasComment("Ore Attività - prima era ([dbo].[f_hourInterval]([inizio],[fine])) poi sostituita per performance");
|
||||
|
||||
entity.HasOne(d => d.IdxDipendenteNavigation)
|
||||
entity.HasOne(d => d.DipNav)
|
||||
.WithMany(p => p.RegAttivitaNav)
|
||||
.HasForeignKey(d => d.IdxDipendente)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("FK_RegAttivita_Dipendenti");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RilievoTemp>(entity =>
|
||||
modelBuilder.Entity<RilievoTempModel>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.IdxDipendente, e.DtRilievo });
|
||||
|
||||
entity.ToTable("RilievoTemp");
|
||||
|
||||
entity.Property(e => e.IdxDipendente).HasColumnName("idxDipendente");
|
||||
|
||||
entity.Property(e => e.DtRilievo)
|
||||
@@ -287,19 +283,17 @@ namespace GPW.CORE.Data
|
||||
.HasColumnType("decimal(9, 3)")
|
||||
.HasColumnName("tempRil");
|
||||
|
||||
entity.HasOne(d => d.IdxDipendenteNavigation)
|
||||
entity.HasOne(d => d.DipNav)
|
||||
.WithMany(p => p.RilievoTempNav)
|
||||
.HasForeignKey(d => d.IdxDipendente)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("FK_RilievoTemp_Dipendenti");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Timbrature>(entity =>
|
||||
modelBuilder.Entity<TimbratureModel>(entity =>
|
||||
{
|
||||
entity.HasKey(e => new { e.IdxDipendente, e.DataOra });
|
||||
|
||||
entity.ToTable("Timbrature");
|
||||
|
||||
entity.HasIndex(e => new { e.IdxDipendente, e.Entrata }, "ix_Timbrature_IdxDip_Entrata");
|
||||
|
||||
entity.Property(e => e.IdxDipendente).HasColumnName("idxDipendente");
|
||||
@@ -323,7 +317,7 @@ namespace GPW.CORE.Data
|
||||
.HasColumnName("IPv4")
|
||||
.HasDefaultValueSql("(N'0.0.0.0')");
|
||||
|
||||
entity.HasOne(d => d.IdxDipendenteNavigation)
|
||||
entity.HasOne(d => d.DipNav)
|
||||
.WithMany(p => p.TimbratureNav)
|
||||
.HasForeignKey(d => d.IdxDipendente)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
|
||||
Reference in New Issue
Block a user