using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FLocal.Core.DB { interface IDBConnection { Dictionary LoadById(ITableSpec table, int id); Dictionary[] LoadByIds(ITableSpec table, int[] ids); int[] LoadIdsByConditions(ITableSpec table, conditions.AbstractCondition conditions, Diapasone diapasone, JoinSpec[] joins, SortSpec[] sorts); ILock lockTable(ITableSpec table); ILock lockRow(ITableSpec table, int id); void update(ITableSpec table, int id, Dictionary data); void delete(ITableSpec table, int id); //do we really need this? } static class IDBConnectionExtensions { public static int[] LoadIdsByConditions(this IDBConnection connection, ITableSpec table, conditions.AbstractCondition conditions, Diapasone diapasone, params JoinSpec[] joins) { return connection.LoadIdsByConditions(table, conditions, diapasone, joins, new SortSpec[] { new SortSpec(table.getIdSpec(), true) }); } } }