Skip to content

Can Strongly Typed Convenience Methods be Added? #313

Description

@AdamDotNet

Hello.

Most/all ADO.Net providers I've used have returned their specific types instead of the System.Data.Common types. An example is PostgreSQL:CreateCommand().

Are you opposed to these convenience methods?

Taking a glance at 0.25.1 code, seems like, for example, it could be changed from:

protected override DbCommand CreateDbCommand() => new MySqlCommand(this, CurrentTransaction);

To:

/// <summary>
/// TODO: Documentation
/// </summary>
/// <returns></returns>
public new MySqlCommand CreateCommand() => new MySqlCommand(this, CurrentTransaction);

protected override DbCommand CreateDbCommand() => CreateCommand();

It would be good to apply these kinds of changes to all applicable DbConnection, DbCommand, etc. methods as well. This would make provider specific, and helpful, APIs become more visible and reduce friction from always having to cast from the common types. Example: #127, you can't see AddWithValue unless you cast.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions