As I already know there is overload in creating the methods, which are example, a method where you have the option of passing 2 or 3 parameters calling the same function:
//Soma 2 numeros
public int Somar(int a, int b)
{
return a + b;
}
//Soma 3 numeros
public int Somar(int a,int b, int c)
{
return a + b + c;
}
The question is: Can I create a return overload? For example:
public PessoaJuridica RetornarPessoa(string id)
{
return new PessoaJuridica();
}
public PessoaFisica RetornarPessoa(string id)
{
return new PessoaFisica();
}
The need arose because I have two methods with different names and it would be easier for me to use the same name, as they do "the same thing".