I have a general controller to which I pass a class containing only properties. It all works great, but ...
I want to create another class in the Controller class that inherits the passed class.
Example:
public class Products
{
public Int32 ProductID {get; set;}
public String ProductName {get; set;}
}
public class ProductController : Controller<Products>
{
public ProductsController() : base("Products", "ProductID", "table", "dbo")
{
}
}
public class Controller<T> : IDisposable where T : new()
{
protected Controller(String tablename, String keyname, String entitytype, String tableschema = "dbo")
{
...
}
public class Recordset : T
{
public Int32 myprop {get; set;}
public void MoveNext()
{
}
}
}
How to create a Recordset class using T as inherited?
Chris source
share