I am calling function of the same class from constructor. But its giving me the error.
public class Connection
{
public Connection()
{
}
public Connection(string parameter) : this(GetConnection(parameter))
{
}
private static string GetConnection(string parameter)
{
return parameter;
}
}
But public Connection(string parameter) : this(GetConnection(parameter))
is giving me error.
The error is:
Constructor 'Test.Connection.Connection(string)' cannot call itself.
What is the error behind this. Is this type of calling possible??
Thanks!!!
`