private void SetSqlStatement(SqlStatementsTypes type, string sql) { var _sql = m_SqlList.FirstOrDefault(s => s.TableName == this.TableName && s.Type == type) ?? new SqlStatements() { Type = type, TableName = this.TableName }; _sql.SqlStatement = sql; m_SqlList.Add(_sql); }
private static DboCommand GetDboCommand(Expression <Func <T, bool> > predicate = null, bool useFieldNames = true, SqlStatementsTypes sqlType = SqlStatementsTypes.Select, object obj = null) { var _tableDef = TableDefinition.GetTableDefinition(typeof(T)); var _selectFields = _tableDef.GetStatementSelect(sqlType == SqlStatementsTypes.SelectReload); DboCommand _sqlCommand = null; switch (sqlType) { case SqlStatementsTypes.Select: _sqlCommand = GetCommandSelect(_selectFields, predicate, _tableDef); break; case SqlStatementsTypes.DeleteAll: _sqlCommand = GetCommandDelete(predicate); break; case SqlStatementsTypes.SelectReload: _sqlCommand = GetCommandSelectReloadMe(_selectFields, obj); break; default: throw new NotImplementedException(); } return(_sqlCommand); }
private string GetSqlStatement(SqlStatementsTypes type) { var _sql = m_SqlList.FirstOrDefault(s => s.TableName == this.TableName && s.Type == type); return(_sql == null ? "" : _sql.SqlStatement); }
public NotifyRecordChangesEventArgs(int recordsAffected, SqlStatementsTypes changeType, TransactionObject transaction) { ChangeType = changeType; Transaction = transaction; RecordsAffected = recordsAffected; }