Dapper.Contrib Generate Update Script With ROWLOCK

c# dapper dapper-extensions

Question

I am using Dapper as ORM and generating insert,update script by Dapper.Contrib extensions. I want to generate Update script include Rowlock. Is there any usage except changing generic code below in SqlMapperExtensions.

 public static bool Update<T>(this IDbConnection connection....
     var proxy = entityToUpdate as IProxy;
     ......
     ......
     var sb = new StringBuilder();
     sb.AppendFormat("update {0} set ",name);

     var allProperties = TypePropertiesCache(type);
     .......

Popular Answer

Dapper.Contrib and the extensions there does not support ROWLOCK and there is no way to configure Dapper to use it, so right now you would have to modify the base code or add your own extension with support for ROWLOCK.



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why