using System.ComponentModel; using System.Text.RegularExpressions; using Gestor.Model.Attributes; namespace Gestor.Model.Domain.Generic; public class EnderecoBase : DomainBase { private string _cep; private string _endereco; private string _numero; private string _bairro; private string _cidade; private string _estado; [Log(true)] public string Cep { get { if (_cep == null || !Regex.IsMatch(_cep, "[0-9]+")) { return ""; } return _cep.Trim(); } set { _cep = value; } } [Log(true)] [Description("ENDEREÇO")] public string Endereco { get { return _endereco; } set { _endereco = value; } } [Log(true)] [Description("NÚMERO")] public string Numero { get { return _numero?.ToUpper(); } set { _numero = value; } } [Log(true)] public string Complemento { get; set; } [Log(true)] public string Bairro { get { return _bairro; } set { _bairro = value; } } [Log(true)] public string Cidade { get { return _cidade; } set { _cidade = value; } } [Log(true)] public string Estado { get { return _estado?.ToUpper().Trim(); } set { _estado = value; } } }