T
Tony Johansson
Hello!
If I for example want to Serialize an object of this class Product se below.
Will this cause any problems because of all the members is private ?
In all the examples I have seen is all the members field public and that
is not what they normally are.
public class Product
{
private long Id;
private string Name;
private Price;
public Product(long id, string name, double price, string notes)
{
Id = id;
Name = name;
Price = price;
Notes = notes;
}
public override string ToString()
{
return string.Format("{0}: {1} (${2:F2}) {3}", Id, Nmae, Price,
Notes);
}
}
//Tony
If I for example want to Serialize an object of this class Product se below.
Will this cause any problems because of all the members is private ?
In all the examples I have seen is all the members field public and that
is not what they normally are.
public class Product
{
private long Id;
private string Name;
private Price;
public Product(long id, string name, double price, string notes)
{
Id = id;
Name = name;
Price = price;
Notes = notes;
}
public override string ToString()
{
return string.Format("{0}: {1} (${2:F2}) {3}", Id, Nmae, Price,
Notes);
}
}
//Tony