I'm trying to create a controller class for my database, but some tables only have one primary key, and some have multiple. And the data type of the primary key differs between some tables.
I would like to create a generic class with a list of dynamic types for the different types of keys
public class GenericClass<Model, [Types]<Type>> {
public GenericClass() {
foreach(Type t in Types) Console.WriteLine(t);
}
public Model Get(Types[0] Id1) {
return new Model(Id1);
}
}
Where Types is a list of types.
Is anything like this possible in C#?
What happens if you have a
listofType?result: