Thsi Is My Model:
public VoyageReservedViewModel{
public List<string> preFactorID { get; set; }
public int Code{ get; set; } }
I want to Add String To List <String> by Thsi Code:
VoyageReservedViewModel Obj = new VoyageReservedViewModel();
foreach (var item in result)
{
Obj.preFactorID.Add("My String Value");
}
But I Reseved This Error:
An exception of type 'System.NullReferenceException' occurred in Sample.dll but was not handled in user code