public IValuesQuery ValuesQuery <T>() where T : class { var criteriaQuery = new ValuesCriteriaQuery(typeof(T)); ((IInternalQuery)criteriaQuery).SetQueryEngine(_storageEngine); return(criteriaQuery); }
public long Count(Type underlyingType, IConstraint constraint) { var valuesCriteriaQuery = new ValuesCriteriaQuery(underlyingType); valuesCriteriaQuery.Add(constraint); var valuesQuery = valuesCriteriaQuery.Count("count"); var values = GetValues((IInternalValuesQuery)valuesQuery, -1, -1); var count = (Decimal)values.NextValues().GetByIndex(0); return(Decimal.ToInt64(count)); }