You got it now devonl. Let's use "member variable" from here. :) My english is not so good.
You're right. My member variables are all private, but I need to access them inside their classes. Let's suppose:
Code:
class B
{
private double price;
public double Price
{
get {return price;}
set {price=value;}
}
//Here is my problem
public double TotalPrice
{
//Even setting a value to price before, price = 0 and dosen't work
get{return price * units;}
//Price has the correct value and works
get{return Price * units;}
}
}
The only member variables with value were the enums.
and...
//Suppose Get is a function and 5 is the id
//Here, price in b is ok , b.Price is ok and b.TotalPrice is ok
B b = Get(B, 5);
but...
A a = Get(A, 6);
//Now internally b.price = 0 but b.Price is ok
//so
double price = a.b.Price; //ok
double totalPrice = a.b.TotalPrice // not ok because it used price internally
This issue was solved as described above, but is this correct?
Lazy and proxies are the "problem".
Thank you.