- Timestamp:
- 06/04/09 17:04:38 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataAccess.ADOHelper/3.2/DataAdapterBase.cs
r1580 r2004 138 138 } 139 139 140 protected ICollection<ObjT> FindMultiple(Selector selector) { 140 private ICollection<ObjT> FindMultiple(Selector selector, 141 int from, int size) { 141 142 ITransaction trans = 142 143 session.GetCurrentTransaction(); … … 150 151 selector(); 151 152 153 if (from > 0 && size > 0) 154 found = found.Skip<RowT>(from).Take<RowT>(size); 155 152 156 IList<ObjT> result = 153 157 new List<ObjT>(); … … 167 171 } 168 172 } 173 } 174 175 protected ICollection<ObjT> FindMultiple(Selector selector) { 176 return FindMultiple( 177 selector, 0, -1); 169 178 } 170 179 … … 244 253 } 245 254 255 public virtual ICollection<ObjT> GetAll(int from, int size) { 256 //note - this base implementation is inefficient, 257 //consider overriding the implementation 258 //in derived adapters (based on a query (SQL LIMIT)) 259 return new List<ObjT>( 260 FindMultiple( 261 new Selector(dataAdapter.FindAll), 262 from, size)); 263 } 264 246 265 protected virtual bool doDelete(ObjT obj) { 247 266 bool success = false; -
trunk/sources/HeuristicLab.DataAccess/3.2/Interfaces/IDataAdapter.cs
r1493 r2004 48 48 49 49 /// <summary> 50 /// Get all objects (paged) 51 /// </summary> 52 /// <returns></returns> 53 ICollection<ObjT> GetAll(int from, int size); 54 55 /// <summary> 50 56 /// Deletes the object 51 57 /// </summary>
Note: See TracChangeset
for help on using the changeset viewer.