S
Steve Richter
I have a class, "BaseUserTable", that must be derived from to be used
correctly:
class BaseUserTable
{
public virtual string TableName
{
get { throw( new ApplicationException( "where's the TableName
property in the derived class??" )) ; }
}
}
( the idea is that BaseUserTable contains methods for managing the
UserTable, only an application that uses the class must supply the
actual table name and database connection string. )
How do I do this in c#/.net? I want derived classes to get a compile
error if they dont implement the required virtual methods and
properties.
I am curious if an interface can do the trick. I just dont want to have
to implement the interface in this base class.
thanks,
-Steve
correctly:
class BaseUserTable
{
public virtual string TableName
{
get { throw( new ApplicationException( "where's the TableName
property in the derived class??" )) ; }
}
}
( the idea is that BaseUserTable contains methods for managing the
UserTable, only an application that uses the class must supply the
actual table name and database connection string. )
How do I do this in c#/.net? I want derived classes to get a compile
error if they dont implement the required virtual methods and
properties.
I am curious if an interface can do the trick. I just dont want to have
to implement the interface in this base class.
thanks,
-Steve