Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ICloneable on MySqlCommand #583

Closed
ghd258 opened this issue Nov 20, 2018 · 3 comments
Closed

Implement ICloneable on MySqlCommand #583

ghd258 opened this issue Nov 20, 2018 · 3 comments
Assignees

Comments

@ghd258
Copy link

@ghd258 ghd258 commented Nov 20, 2018

public object Clone()
{
DataCommand cmd = new DataCommand();
if (m_DbCommand != null)
{
if (m_DbCommand is ICloneable)
{
cmd.m_DbCommand = ((ICloneable)m_DbCommand).Clone() as DbCommand;
}
else
{
throw new ApplicationException("A class that implements IClonable is expected.");
}
}
cmd.m_DatabaseName = m_DatabaseName;
return cmd;
}

@bgrainger bgrainger changed the title ((ICloneable)m_DbCommand).Clone() as DbCommand abnormal Implement ICloneable on MySqlCommand Nov 20, 2018
@bgrainger
Copy link
Member

@bgrainger bgrainger commented Nov 20, 2018

This is required for API compatibility with Connector/NET.

ICloneable was implemented on MySqlParameter recently: #567.

@ghd258
Copy link
Author

@ghd258 ghd258 commented Nov 20, 2018

MySql.Data can use this method, but the MySqlConnector0.47.1 version is wrong, can it be solved?

@bgrainger bgrainger self-assigned this Nov 20, 2018
@bgrainger
Copy link
Member

@bgrainger bgrainger commented Dec 8, 2018

Fixed in 0.48.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants