dapper 异步修改方法

 public async Task<int> UpdateStatusByWarehouseId(bool isValid, int warehouseId)
        {
            using (var conn = GetDBConnection())
            {
                string sqlText = $@"UPDATE warehouse 
                                  SET 
                                  IsValid=@IsValid
                                  WHERE 
                                  WarehouseId=@WarehouseId ";
                return await conn.ExecuteAsync(sqlText, new { IsValid = isValid, WarehouseId = warehouseId });
            }
        }

 

上一篇:DbHelper


下一篇:重写慢日志解析程序,实现打印慢SQL信息及其所属数据库