C# Class Array basic question items
Posted on 2012-08-31
I have an API that has a class as something I need to pass to it one of it's attributes. I am aweful with arrays. So what it has is this:
It has a class named CustomerDetail with attributes of course CustID, CustName etc. Then the attribute I need to pass into the API method is called CustomerDetails which is expecting it looks like CustomerDetail so it accepts multiple. So what I did was this and intellisense seemed to work:
CustomerDetail prs = new CustomerDetail;
prs.CustID = 2;
prs.CustName = "Cust1";
I get an object not set to an instance of an object error on CustID. What am I doing wrong. The attribute CustomerDetails when I hover over it shows CustomerDetail.