I need a base class for my DTO classes which will be used in my generic interfaces.
But the DTO classes have nothing in common. They are just dumb classes containing some properties.
public void GetGridData()
{
IDataForGrid<DTOBase> aa;
if(request == 1) aa = new CustomerGridData;
if(request == 2) aa = new OrderGridData;
var coll = aa.GetList();
}
public class CustomerGridData : IDataForGrid<CustomerDTO>
{
...
}
It is not a bad design, although somewhat uncommon. Think of it this way - there are at least two benefits while there are no drawbacks:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With