Implemetato databese locale con EntityFramework

This commit is contained in:
2026-02-17 17:40:33 +01:00
parent 544c9e8237
commit e7357bd78a
45 changed files with 989 additions and 119 deletions

View File

@@ -0,0 +1,51 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using SteUp.Shared.Core.Dto;
namespace SteUp.Shared.Core.Entities;
public class Scheda
{
[Key]
public int Id { get; set; }
public string? CodJfas { get; set; }
[Required]
public string CodMdep { get; set; } = string.Empty;
public DateOnly Data { get; set; }
[Required]
public string Rilevatore { get; set; } = string.Empty;
public Ispezione? Ispezione { get; set; }
public string? DescrizioneReparto { get; set; }
public string? ActivityTypeId { get; set; }
public string? Note { get; set; }
public string? Responsabile { get; set; }
public int Scadenza { get; set; } = 24;
[NotMapped]
public JtbFasiDto? Reparto
{
get
{
if (_reparto == null && CodJfas != null)
{
_reparto = new JtbFasiDto
{
CodJfas = CodJfas,
Descrizione = DescrizioneReparto
};
}
return _reparto;
}
set
{
_reparto = value;
if (value == null) return;
CodJfas = value.CodJfas;
DescrizioneReparto = value.Descrizione;
}
}
private JtbFasiDto? _reparto;
}