Follow up from This Question -
In the Question
class I have the following properties (I'm simplifying here)
public class Question : IDisposable, IEquatable<Question>{
protected virtual DataRow Row{ get { return DataTable.Rows[0]; } }
public string Value { get { return this.Row.Field<string>("Value"); } }
}
now, for the SessionQuestion
class I want to keep this in play, but I want to read the Value field from a different data table :
public class SessionQuestion : Question, IEquatable<SessionQuestion>{
protected override DataRow Row { get { return OtherDataTable.Rows[0]; } }
}
Now, if I were to say something like :
new SessionQuestion( ).Value
would that return the value from DataTable.Rows[0]
, or OtherDataTable.Rows[0]
? I want it to return the value from OtherDataTable
, so if this doesn't work, what would I need to do so it would work properly?