I have a library that contains a class. This class is intended to be extended. It will connect to the database and generate class entries that extend it. Now I want to return an array of an expandable class type. How can i do this? For example:
public this[] search(string search) {
}
How to do it?
EDIT: I use generics, this is a generic class. This means that I have no clue as to which class that will expand mine will be. Therefore, I can’t just add the class name to [] ...
EDIT 2: As pointed out, returning an array from this makes no sense (my mistake then). So I want to return an array of an extended class type. For example:
public abstract class MappingObject {
public ExtendedClassType[] search (string search) {
}
}
Solution found._. I'm sorry it was very simple ...
public abstract class MappingObject<T> where T : new() {
public static List<T> search(string search) {
}
}