AFAIK, It's agreed that accessing virtual members from constructor is a dangerous practice. Can we overcome this through using an additional step, a method, to make required initialization? like the following:
public class EntityAlpha {
public virtual string Value { get; protected set; }
public EntityAlpha(string value) {
Value = value;
}
}
to be replaced with
public class EntityAlpha {
public virtual string Value { get; protected set; }
public EntityAlpha(string value) {
AssignValue(value);
}
private void AssignValue(string value) {
Value = value;
}
}
What are consequences of using this additional method? Does it still dangerous like using virtual member in constructor or worst?! How to test if this assumption is not harmful?