0

Hi I am a new developer to c# and I am trying to implement a connector to a database using native c#. I am wondering if there are some "standard" interface (like JDBC in java, ODBC in c) to implement so that c# developer can use to connect to database.

I do notice some interfaces and abstract classes like https://msdn.microsoft.com/en-us/library/system.data.common.dbconnection(v=vs.110).aspx.

I am not sure if I should directly implement IDbConnection interface or I should extends the abstract class DbConnection. Also is there a complete list of interfaces so that I can claim my driver support certain version of apis.

One last question, I looked at Mysql connector for .net and seems there area not implementing/extending those interfaces/classes. https://github.com/mysql/mysql-connector-net/blob/6.9/Source/MySql.Data/Connection.cs Is there a reason why Mysql did not do it? It makes me feel those interfaces are not standard.

0

1 Answer 1

1

I think inheriting DbConnection and implementing ICloneable will be sufficient. If you look at the MySql sources carefully you will see that DbConnection and ICloneable are inherited and implemented by the partial class of MySqlConnection which is in here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.