2

Que tal, tengo mi siguiente get y set:

  public virtual string Tp_Do
    {
        get;
        set;
    }

    public virtual string N_Rf
    {
        get;
        set;
    }

Se puede unir en un solo get y set Tp_Do y N_Rf?

espero me puedan ayudar.

1 respuesta 1

2

Claro que si, con una propiedad calculada:

public class Persona
{
    public string PrimerPropiedad { get; set; }
    public string SegundaPropiedad { get; set; }

    public string MiPropiedadCalculada
    {
        get { return PrimerPropiedad + SegundaPropiedad; }
    }
}

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.