Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dapper-extensions GetList() with (nolock)

Does anyone know if it's possible to tell dapper to append with (nolock) when using connection.GetList<TView>()?

I am using this as the R from my CQRS model and it works well but I'm concerned now we're doing a bit more heavy reading that it will start locking out tables. I'd rather not add transactions into the mix if possible.

like image 626
Beannie Avatar asked Nov 10 '22 05:11

Beannie


1 Answers

dapper is really just a set of extension methods plunked on top of ADO.NET. It's meant to be a generic abstraction allowing it to interop with (m)any RDMS's.

Since with (nolock) is SQL Server syntax, it wouldn't make a ton of sense for it to be baked into any of the methods, extension lib or otherwise.

Moreover, the dapper-extensions package is meant to help with the simple task of CRUD operations. If the complexity goes beyond these operations, it's time for .Query() and some custom SQL.

like image 107
pim Avatar answered Nov 14 '22 22:11

pim