/// <summary> /// Gets the record count /// </summary> /// <param name="filterExpression">the filter as a lambda expression</param> /// <returns></returns> public int GetCount(Expression <Func <T, bool> > filterExpression) { var parser = new ObjectModel.WhereExpressionParser <T>(DataMap, SqlDialect) { UseQuotedIdentifier = CommandBuilder.UseQuotedIdentifier }; var result = parser.Parse(filterExpression); return(GetCountInternal(result.SqlText, FillMethod.FilterText, result.Parameters)); }
/// <summary> /// Fills the specified collection. /// </summary> /// <param name="collection">The collection.</param> /// <param name="start">The row index to start filling from</param> /// <param name="length">The number of rows to fill</param> /// <param name="filterExpression">the filter as a lambda expression</param> /// <returns></returns> public int FillRange(ICollection <T> collection, int start, int length, Expression <Func <T, bool> > filterExpression) { var parser = new ObjectModel.WhereExpressionParser <T>(DataMap, SqlDialect) { UseQuotedIdentifier = CommandBuilder.UseQuotedIdentifier }; var result = parser.Parse(filterExpression); return(FillRangeInternal(collection, start, length, result.SqlText, FillMethod.FilterText, result.Parameters)); }