mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	修改 Mysql, SqlServer ,Odbc AOP command 拦截
This commit is contained in:
		@@ -382,6 +382,8 @@ where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRI
 | 
				
			|||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        cmd.CommandText = sql;
 | 
					                        cmd.CommandText = sql;
 | 
				
			||||||
                        cmd.CommandType = CommandType.Text;
 | 
					                        cmd.CommandType = CommandType.Text;
 | 
				
			||||||
 | 
					                        var before = new Aop.CommandBeforeEventArgs(cmd);
 | 
				
			||||||
 | 
					                        this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
 | 
				
			||||||
                        return cmd.ExecuteScalar();
 | 
					                        return cmd.ExecuteScalar();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -474,6 +474,8 @@ use [" + database + "];", tboldname ?? tbname);
 | 
				
			|||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        cmd.CommandText = sql;
 | 
					                        cmd.CommandText = sql;
 | 
				
			||||||
                        cmd.CommandType = CommandType.Text;
 | 
					                        cmd.CommandType = CommandType.Text;
 | 
				
			||||||
 | 
					                        var before = new Aop.CommandBeforeEventArgs(cmd);
 | 
				
			||||||
 | 
					                        this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
 | 
				
			||||||
                        return cmd.ExecuteScalar();
 | 
					                        return cmd.ExecuteScalar();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -393,6 +393,8 @@ where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRI
 | 
				
			|||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        cmd.CommandText = sql;
 | 
					                        cmd.CommandText = sql;
 | 
				
			||||||
                        cmd.CommandType = CommandType.Text;
 | 
					                        cmd.CommandType = CommandType.Text;
 | 
				
			||||||
 | 
					                        var before = new Aop.CommandBeforeEventArgs(cmd);
 | 
				
			||||||
 | 
					                        this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
 | 
				
			||||||
                        return cmd.ExecuteScalar();
 | 
					                        return cmd.ExecuteScalar();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -383,6 +383,8 @@ where a.table_schema IN ({0}) and a.table_name IN ({1}) and a.index_name <> 'PRI
 | 
				
			|||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        cmd.CommandText = sql;
 | 
					                        cmd.CommandText = sql;
 | 
				
			||||||
                        cmd.CommandType = CommandType.Text;
 | 
					                        cmd.CommandType = CommandType.Text;
 | 
				
			||||||
 | 
					                        var before = new Aop.CommandBeforeEventArgs(cmd);
 | 
				
			||||||
 | 
					                        this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
 | 
				
			||||||
                        return cmd.ExecuteScalar();
 | 
					                        return cmd.ExecuteScalar();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -475,6 +475,8 @@ use [" + database + "];", tboldname ?? tbname);
 | 
				
			|||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        cmd.CommandText = sql;
 | 
					                        cmd.CommandText = sql;
 | 
				
			||||||
                        cmd.CommandType = CommandType.Text;
 | 
					                        cmd.CommandType = CommandType.Text;
 | 
				
			||||||
 | 
					                        var before = new Aop.CommandBeforeEventArgs(cmd);
 | 
				
			||||||
 | 
					                        this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
 | 
				
			||||||
                        return cmd.ExecuteScalar();
 | 
					                        return cmd.ExecuteScalar();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -477,6 +477,8 @@ use [" + database + "];", tboldname ?? tbname);
 | 
				
			|||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        cmd.CommandText = sql;
 | 
					                        cmd.CommandText = sql;
 | 
				
			||||||
                        cmd.CommandType = CommandType.Text;
 | 
					                        cmd.CommandType = CommandType.Text;
 | 
				
			||||||
 | 
					                        var before = new Aop.CommandBeforeEventArgs(cmd);
 | 
				
			||||||
 | 
					                        this._orm?.Aop.CommandBeforeHandler?.Invoke(this._orm, before);
 | 
				
			||||||
                        return cmd.ExecuteScalar();
 | 
					                        return cmd.ExecuteScalar();
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user