Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inheritance problem
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Inheritance problem
Miscellaneous
Thread ID:
00970014
Message ID:
00970014
Views:
48
Here's the situation:

I have this BaseClass:
public abstract class BaseDataSet : DataSet
{
// Constructor and other stuff here

	public virtual bool Validate()
	{
		return true;
	}

}
then i have this derived class:
public class SomeDataset : BaseDataSet, IDataSet
{
// Constructor and other stuff here

	public override bool Validate()
	{
                bool ret = this.DoSomeProcessing();
		return ret;
	}

}
And finally, in some other object, i have this code:
public bool save( IDataSet ds )
{
    if (ds.Validate()}
      { //save it }
The problem:

Only The code in the BaseDataSet class is executed for Validate() thus always return true. It should execute the derived SomeDataset.Validate()

Am i missing something ?
Next
Reply
Map
View

Click here to load this message in the networking platform