Comparing QUERY and EXECUTE in Dapper

I would like to ask what is the best to use when inserting, updating, deleting, deleting, QUERY SPECIFIC DATA using DAPPER? I am really confused about using EXECUTE and QUERY in DAPPER ..

+4
source share
1 answer

This should not be misleading, especially if you look at the signature of the methods open by Dapper (as per the documentation):

public static IEnumerable<T> Query<T>(this IDbConnection cnn, string sql, object param = null, SqlTransaction transaction = null, bool buffered = true)

select, IEnumerable of a type T, , anonymous parameter, - return value Output parameter, input parameter , , Type T. return value Output parameter, DynamicParameters

public static int Execute(this IDbConnection cnn, string sql, object param = null, SqlTransaction transaction = null)

Execute DML, Insert, Update and Delete, . - integer, , SQL Server Set RowCount On, , DML.

, QueryMultiple. GridReader Select, MARS ( ).

, - , , , , , .

+11

All Articles