I'd like to have one interface for all my grid related tasks.The tasks implement this interface:
public interface IDataForGrid<T>
{
IGridResponse<T> GetList(IGridRequest request);
}
The T type is always a DTO class. I cant't create a common interface for this DTOs because they have nothing common.Just a dumb DTO with particular properties.
I'd like to use it like this :
public class Service1
{
public IGridResponse CreateResponse(IGridRequest request)
{
...
IDataForGrid<T> aa;
if(request == 1) aa = new CustomerGridData;
if(request == 2) aa = new OrderGridData;
var coll = aa.GetList();
}
}
public class CustomerGridData : IDataForGrid<CustomerDTO>
{
...
}
The problem is I don't know what to put instead of the T.