Fix vari
This commit is contained in:
@@ -6,11 +6,36 @@ namespace salesbook.Shared.Core.Entity;
|
||||
[Table("vtb_clie_pers_rif")]
|
||||
public class VtbCliePersRif
|
||||
{
|
||||
[PrimaryKey, Column("composite_key")]
|
||||
public string CompositeKey { get; set; }
|
||||
|
||||
private int? _idPersRif;
|
||||
|
||||
[Column("id_pers_rif"), JsonPropertyName("idPersRif"), Indexed(Name = "VtbCliePersRifPK", Order = 1, Unique = true)]
|
||||
public int IdPersRif { get; set; }
|
||||
public int? IdPersRif
|
||||
{
|
||||
get => _idPersRif;
|
||||
set
|
||||
{
|
||||
_idPersRif = value;
|
||||
if (_idPersRif != null && _codAnag != null)
|
||||
UpdateCompositeKey();
|
||||
}
|
||||
}
|
||||
|
||||
private string? _codAnag;
|
||||
|
||||
[Column("cod_anag"), JsonPropertyName("codAnag"), Indexed(Name = "VtbCliePersRifPK", Order = 2, Unique = true)]
|
||||
public string CodAnag { get; set; }
|
||||
public string? CodAnag
|
||||
{
|
||||
get => _codAnag;
|
||||
set
|
||||
{
|
||||
_codAnag = value;
|
||||
if (_idPersRif != null && _codAnag != null)
|
||||
UpdateCompositeKey();
|
||||
}
|
||||
}
|
||||
|
||||
[Column("persona_rif"), JsonPropertyName("personaRif")]
|
||||
public string PersonaRif { get; set; }
|
||||
@@ -38,4 +63,7 @@ public class VtbCliePersRif
|
||||
|
||||
[Column("data_ult_agg"), JsonPropertyName("dataUltAgg")]
|
||||
public DateTime? DataUltAgg { get; set; } = DateTime.Now;
|
||||
|
||||
private void UpdateCompositeKey() =>
|
||||
CompositeKey = $"{IdPersRif}::{CodAnag}";
|
||||
}
|
||||
Reference in New Issue
Block a user