public abstract class MyBase
{
/// <summary>
/// The my test method. divyang
/// </summary>
public virtual void MyVirtualMethodWhichIsOverridedInChild()
{
Console.Write("Method1 Call from MyBase");
}
/// <summary>
/// The my another test method.
/// </summary>
public abstract void MyAnotherTestMethod();
/// <summary>
/// The my best method.
/// </summary>
public virtual void MyVirualMethodButNotOverridedInChild()
{
Console.Write("Method2 Call from MyBase");
}
}
now make base class
public abstract class CrtpBaseWrapper<T> : MyBase
where T : CrtpBaseWrapper<T>
{
}
then you can make your subclass
public class CrtpChild : CrtpBaseWrapper<CrtpChild>
{
/// <summary>
/// The my test method. divyang
/// </summary>
public override void MyVirtualMethodWhichIsOverridedInChild()
{
Console.Write("Method1 Call from CrtpChild");
}
/// <summary>
/// The my another test method.
/// </summary>
public override void MyAnotherTestMethod()
{
Console.Write("MyAnotherTestMethod Call from CrtpChild");
}
}