este es el Código de la clase:
public class MSequence
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Comments { get; set; }
public MSquenceType MSType { get; set; }
public List<MItem> Items { get; set; }
public MSequence()
{
}
}
public class MSquenceType
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
public class MItem
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Comments { get; set; }
public int Duration { get; set; }
public int Priority { get; set; }
public MItemType MIType { get; set; }
public string File { get; set; }
}
public enum MItemType { Video, Sound, Image }
Esta es la lista donde creo9 el item que quiero utilizar en la otra lista
var item = new System.Collections.Generic.List<MItem>
{
new MItem()
{
Id = 4,
Name = "El Triple",
Description = "Desc1",
MIType = MItemType.Video,
Duration = 5,
Priority = 2
},
new MItem()
{
Id = 15,
Name = "1 año Gratis",
Description = "Desc1",
MIType = MItemType.Video,
Duration = 5,
Priority = 2
},
new MItem()
{
Id = 3,
Name = "El Triple",
Description = "Desc1",
MIType = MItemType.Video,
Duration = 5,
Priority = 2
},
new MItem()
{
Id = 2,
Name = "Verano conecta'o",
Description = "Desc1",
MIType = MItemType.Video,
Duration = 5,
Priority = 2
},
new MItem()
{
Id = 1,
Name = "Llama y llama",
Description = "Desc1",
MIType = MItemType.Video,
Duration = 5,
Priority = 2
},
new MItem()
{
Id = 6,
Name = "Internet sin límites",
Description = "Desc1",
MIType = MItemType.Video,
Duration = 5,
Priority = 2
}
};
Estas es la lista donde quiero cargar el item que creo en la lista anterior.
var seqs = new System.Collections.Generic.List<MSequence>
{
new MSequence()
{
Name = "Seq1",
Description = "Desc1",
Comments = "Comments1",
Id = 1,
Items =
},
new MSequence()
{
Name = "Seq5",
Description = "Desc1",
Comments = "Comments1",
Id = 5
},
new MSequence()
{
Name = "Seq4",
Description = "Desc1",
Comments = "Comments1",
Id = 4
},
new MSequence()
{
Name = "Seq3",
Description = "Desc1",
Comments = "Comments1",
Id = 3
},
new MSequence()
{
Name = "Seq2",
Description = "Desc1",
Comments = "Comments1",
Id = 2
}
};
MItem
en cada uno de los elementos deseqs
item
la quieres insertar en la primer posición de la variableseqs
?