Exemplo n.º 1
0
        public FluentEntityAdoSelect(IDaoHelper daoHelper, bool allColumns, bool autoReset)
        {
            _daoHelper           = daoHelper ?? throw new ArgumentNullException(nameof(daoHelper));
            _whereHelper         = new FluentEntityAdoWhereHelper <T>(autoReset);
            _joinCommandBuilder  = new StringBuilder();
            _orderCommandBuilder = new StringBuilder();

            _tableName  = FluentEntityAdoHelper.GetTableName(typeof(T));
            _tableNames = new HashSet <string>
            {
                _tableName
            };
            _selectedColumns = new Dictionary <string, List <FluentEntityProperty <EntityColumnAttribute> > >
            {
                { _tableName, new List <FluentEntityProperty <EntityColumnAttribute> >() }
            };
            _joinedTableObjects = new Dictionary <string, object>();

            _referenceModel = new T();
            _allColumns     = allColumns;
            _autoReset      = autoReset;

            if (allColumns)
            {
                AddAllColumns <T>(_tableName);
            }
        }
Exemplo n.º 2
0
 public FluentEntityAdoDelete(IDaoHelper daoHelper)
 {
     _daoHelper   = daoHelper ?? throw new ArgumentNullException(nameof(daoHelper));
     _whereHelper = new FluentEntityAdoWhereHelper <T>();
     _baseCommand = $"DELETE FROM {FluentEntityAdoHelper.GetTableName(typeof(T))}";
 }