Greetings.
I have a method that gets 3 paraments: collection, business, quantity
Collection: is a collection class that inherits from another class, eg, man, woman, senior ... Business: is a class that contains the methods that handle the queries before accessing the database (3-tier programming). Quantity: is just a value of the integer type.
Now imagine that my collection might be: manCollection, womanColection, elderlyCollection or childCollection.
Imagine my business class might be: men, Business, Business, Elderly, Business ...
What I want is for my method to receive any of these values and so I will use it for any of these classes.
I researched generic methods, generic classes, Linq, but I could not solve the problem.
Follow the Method code:
private void MeuMetodo(HomemCollection colecao, HomemNegocios negocios, int quantidade)
{
string retorno = negocios.nomeDoMetodoDaCamadaNegocios(colecao, negocios, quantidade)
}
This method above can only receive the collection and the business of man, I want to leave this method receiving any other class.
If someone has a link or material for me to study this situation, I am very grateful.