dapper-- query timeout

 

In the actual project in, it will perform during the execution of a large amount of computation, very long time.

When this time in the practical application of the project, will be reported when the dapper execute sql "Object reference not to the instance of the object."

Internet search a lot of content, can not solve.

Later, step by step output, may find problems when stored procedure execution.

So query timeout on the use of the dapper

Dapper currently used to call a stored procedure in SQL statements task of backing up data, but the problem CommandTimeout execution timeout occurs, such as:

 

DapperThe Excutemethod has several versions of overloading, which contains the option to set the query timeout, such as:

Where: commandTimeoutparameter is the query timeout

Specific call the method:

The above code, we will Dapper's Exceutequery method timeout became 60 seconds.

 Used in the project

 

Guess you like

Origin www.cnblogs.com/ys9527/p/10941839.html