I need to make an interface implement a list of a certain type:
public class ITrade<T>
{
public int date { get; set; }
public double price { get; set; }
public double amount { get; set; }
public string type { get; set; }
}
interface ITrades<T>
{
List<ITrade<T>> Trades { get; set; }
}
But I want ITrade to take a concrete class as a parameter:
public class Trade
{
public int date { get; set; }
public double price { get; set; }
public double amount { get; set; }
public int tid { get; set; }
public string type { get; set; }
}
The idea is this: Trade
is in a template file and I want every template to have at least the properties of ITrade
. That is, I need to force the elements of the list:
List<ITrade<T>> Trades { get; set; }
have at least the properties of ITrade
plus some more properties. I can not put this in ITrade
because I want to separate a general interface that can work with multiple models and I want to keep the models separate.