DotNetGnat
Programmer
Hi Guys, i wanted to use optional parameters in c# but i read that it is not allowed...anyways i have something like this and it is not throwing an error...can someone please check whats wrong with this:
in the interface i have:
and in the class i have:
[red]the error it throws is that class already has definition for UserList[/red]
any suggestions...thanks
-DNG
in the interface i have:
Code:
string UserList()
{
get;
}
string UserList(int flag)
{
get;
}
and in the class i have:
Code:
public string UserList
{
get
{
return UserList(1);
}
}
public string UserList(int flag)
{
get
{
if (flag!=null)
{
//do something
}
else
{
//do someother thing
}
}
}
[red]the error it throws is that class already has definition for UserList[/red]
any suggestions...thanks
-DNG