On the link I show you all my classes in my program
I have properties in my customerframe class like this:
public string firstName { get; set; }
public string lastName { get; set; }
public CustomerFiles.Phone phone { get; set; }
public CustomerFiles.Email email { get; set; }
public CustomerFiles.Address addressinfo { get; set; }
public string city { get; set; }
public CustomerFiles.Countries countryinfo { get; set; }
public string street { get; set; }
public string zipcode { get; set; }
but my problem is that when doing this I get error pointing to these 4 properties
public CustomerFiles.Phone phone { get; set; }
public CustomerFiles.Email email { get; set; }
public CustomerFiles.Address addressinfo { get; set; }
public CustomerFiles.Countries countryinfo { get; set; }
The error is this
inconsistent accessibility property type is less accessible than
property
Further down in class and I’ll do the following:
contact.FirstName = tbFirstName.Text;
firstName = contact.FirstName;
contact.LastName = tbLastName.Text;
lastName = contact.LastName;
contact.PhoneData = tbCellPhone.Text;
phone = contact.PhoneData;
contact.EmailData = tbHomePhone.Text;
email = contact.EmailData;
//inside address class
address.City = tbCity.Text;
city = address.City;
address.Country = cbCountry.Text;
countryinfo = address.Country;
address.Street = tbStreet.Text;
street = address.Street;
address.ZipCode = tbZipCode.Text;
zipcode = address.ZipCode;
But why do I get problem with my properties? How can I solve this to make it work? thanks in advance
It looks like when you created the CustomerFiles.Phone class it would look something like:
This means that the class is internal. You can’t expose an internal class via a public property. That is crazy talk.
To fix, you should either change the class to be public:
Or the property to be internal: