Skip to content

Pass commandTimeout to Dapper #15

@iamgmd

Description

@iamgmd

Add the ability to pass commandTimeout value through to Dapper on query.Execute. There are some use-cases where the default commandTimeout is not enough to run lengthy queries:-

example below but would be great to have this passed through as queryOptions or something:

public IEnumerable<TEntityType> Execute<TEntityType>(IDbConnection connection, Func<object[], TEntityType> map)
        {
            var results = connection.Query<TEntityType>(
                commandTimeout: 300,
                sql: this.ToString(),
                types: this._types.ToArray(),
                param: this.Parameters,
                map: map,
                splitOn: string.Join(",", this._splitOn)
            );
            return results.Where(e => e != null);
        }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions