✅ Cant convert a list to list of a class type?
I am new to C# and am stuck on this strange issue, I cant seem to send a list to a different class, as its only accepting a list of type "Customer" (class name), how would I convert or send this information over?
Method which collects info and sends it to save method
Save Method: will be posted as a comment so I dont run out of available words.
3 Replies
Error reads: "Cannot convert from type 'CustomerMaintenence.Customer' to 'Systems.Collections.Generic.List<CustomerMaintence.Customer>'
Ignore the messageboxes, they are debugging code as I am 4 hours deep into this and no closer to getting it running.
you're trying to convert from a single thing to a list of things
you either meant to pass a List, or you need to wrap what you're passing in a List
I DID IT
sorry man I didnt mean to waste your time
so I found the issue was I needed to
do a customers.Add(customer);
which is adding it to a list of type Customer
now it can send over
which would be the passing to to a list which you were talking about
ok thank you very much sorry again wow bad timing on my part