I'm in a mess, I have this code:
public class Clase
{
public string Nombre {get; set;}
public Task<List<NombreClase>>? DetalleClase {get, set;}
public Clase() //constructor
{
DetalleClase = new Task<List<NombreClase>>();
}
}
Because what I need is to call it in the console as follows:
public static void Main(string[] args)
{
var clase = New Clase()
{
Nombre = "Ana",
DetalleClase = new Task<List<NombreClase>>
{
new NombreClase
{
Propiedad1 = '',
Propiedad2 = ''
},
new NombreClase
{
Propiedad1 = '',
Propiedad2 = ''
}
}
};
}
But I don't get a favorable response because the VS compiler tells me that Task<List> doesn't have a constructor that takes 0 arguments.
I hope someone can help me, I'm just getting soaked with c#, I'm coming from Vb.NET