declare list list as object attribute c #

1

I have the following object:

namespace MODELO{
    [Table("Check_lists_PVR")]
    public class Check_lists_PVR{
        [Key]
        private Int64 NroCL { get; set; }
        public DateTime Fecha { get; set; }
        public string Turno { get; set; }
        public string PVR { get; set; }
        public string Operador { get; set; }
    }
}

My intention is to add 3 lists as attributes. The object itself is a check list, each item is divided into "item, status and observation", and the check list consists of 16 items. my idea is to make a list for "items" another for "states" and a last paragraph "observations" but all my attempts to create a list throw error. help please

    
asked by Todema 03.07.2018 в 23:29
source

1 answer

1

If the observations are a simple type as a string, the declaration of the list would be:

public List<string> Observaciones  { get; set; }

On the other hand if observations is a compound type you must create a class Observations that implements it and make a list of objects of that class observations:

public class Observaciones
{
     // Contenido de la clase
}

and the declaration of the list would be:

 public List<Observaciones> Observacioneses { get; set; }

Greetings

    
answered by 04.07.2018 / 07:29
source