I am receiving from the database a single string with this content
One;Two;Three
and I want to store those values in the reportTypeCodes
property in the following class.
public class ReportTypeCode
{
public string codeValue { get; set; }
}
public class Root
{
public string name { get; set; }
public DateTime creationDateTime { get; set; }
public List<ReportTypeCode> reportTypeCodes { get; set; }
}
This is my current attempt:
Var Obj = new Root(){
name="Test",
creationDateTime=Convert.ToDateTime("2021-11-08),
reportTypeCodes=?? // Don't know how to assign it.
}
How can I do it?