Its said that property should not be "Set" only (Code analysis rule CA1044 )and it should be "Get" as well. What should i do if I need to set value to a variable from some other class?
The will keep changing so I cannot pass it through constructor.
Shall I create a function for this as shown below?
class A
{
public void SetValue()
{
b = new B();
b.SetTest(10);
}
}
class B
{
int test;
public void SetTest(int value)
{
test = value;
}
}
What are the other alternatives?