L
Lloyd Dupont
I'm creating a DataProvider, I begin to have something working and was about
to implement IDbParameter. Now I discover that there is a C# subtelty I
don't master:
I wrote
public class FileMakerCommand : IDbCommand
{
.......
public FileMakerDataParameter Parameters
{
get { /* return something */ }
}
....
}
however this is incorrect because IDbCommand require Parameters to return an
IDataParameterCollection
then I wrote (half remembering something I read a while ago):
public class FileMakerCommand : IDbCommand
{
.......
FileMakerDataParameter IDbCommand.Parameters
{
get { /* return something */ }
}
public FileMakerDataParameter Parameters
{
get { /* return something */ }
}
....
}
and it worked.
now I wonder, when this package accessor (the IDbCommand.Parameters one) get
called ? when you cast the instance as just a IDbCommand ? never ? always ?
sometimes in the afternoon ?
could anyone shed some light ?
thanks
to implement IDbParameter. Now I discover that there is a C# subtelty I
don't master:
I wrote
public class FileMakerCommand : IDbCommand
{
.......
public FileMakerDataParameter Parameters
{
get { /* return something */ }
}
....
}
however this is incorrect because IDbCommand require Parameters to return an
IDataParameterCollection
then I wrote (half remembering something I read a while ago):
public class FileMakerCommand : IDbCommand
{
.......
FileMakerDataParameter IDbCommand.Parameters
{
get { /* return something */ }
}
public FileMakerDataParameter Parameters
{
get { /* return something */ }
}
....
}
and it worked.
now I wonder, when this package accessor (the IDbCommand.Parameters one) get
called ? when you cast the instance as just a IDbCommand ? never ? always ?
sometimes in the afternoon ?
could anyone shed some light ?
thanks