This may have been asked many times, and I've been searching around, but for some reason, this doesn't make sense to me. So it seems like I create a new instance, but Visual studio tells me that Object reference not set to an instance of an object.
public class Test{
private Dictionary<string, Service> serviceList;
private void GetList(string ID){
foreach(var service in Service.Load()){
servicelist.Add(service.ID, new Service());
}
}
}
I think when I use new Service(), I basically create a new instance of the Service every single time I move to the next element in the Dictionary? Service is a class