简体   繁体   中英

Dapper.Contrib Generate Update Script With ROWLOCK

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);
     .......

Dapper.Contrib及其扩展不支持ROWLOCK ,也无法配置Dapper使用它,因此,现在您将不得不修改基本代码或添加自己的扩展以支持ROWLOCK

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM