Fix vari
This commit is contained in:
@@ -6,11 +6,36 @@ namespace salesbook.Shared.Core.Entity;
|
||||
[Table("ptb_pros_rif")]
|
||||
public class PtbProsRif
|
||||
{
|
||||
[PrimaryKey, Column("composite_key")]
|
||||
public string CompositeKey { get; set; }
|
||||
|
||||
private string? _codPpro;
|
||||
|
||||
[Column("cod_ppro"), JsonPropertyName("codPpro"), Indexed(Name = "PtbProsRifPK", Order = 1, Unique = true)]
|
||||
public string CodPpro { get; set; }
|
||||
public string? CodPpro
|
||||
{
|
||||
get => _codPpro;
|
||||
set
|
||||
{
|
||||
_codPpro = value;
|
||||
if (_codPpro != null && _idPersRif != null)
|
||||
UpdateCompositeKey();
|
||||
}
|
||||
}
|
||||
|
||||
private int? _idPersRif;
|
||||
|
||||
[Column("id_pers_rif"), JsonPropertyName("idPersRif"), Indexed(Name = "PtbProsRifPK", Order = 2, Unique = true)]
|
||||
public int IdPersRif { get; set; }
|
||||
public int? IdPersRif
|
||||
{
|
||||
get => _idPersRif;
|
||||
set
|
||||
{
|
||||
_idPersRif = value;
|
||||
if (_codPpro != null && _idPersRif != null)
|
||||
UpdateCompositeKey();
|
||||
}
|
||||
}
|
||||
|
||||
[Column("persona_rif"), JsonPropertyName("personaRif")]
|
||||
public string PersonaRif { get; set; }
|
||||
@@ -29,4 +54,7 @@ public class PtbProsRif
|
||||
|
||||
[Column("telefono"), JsonPropertyName("telefono")]
|
||||
public string Telefono { get; set; }
|
||||
|
||||
private void UpdateCompositeKey() =>
|
||||
CompositeKey = $"{CodPpro}::{IdPersRif}";
|
||||
}
|
||||
Reference in New Issue
Block a user