protected virtual IQueryable<TEntity> ApplyStartDateOrientedFiltered(IQueryable<TEntity> query, TGetListInput input) { if (input is IStartDateOrientedFilter && HasProperty<TEntity>("CreationTime")) { var property = typeof(TEntity).GetProperty("CreationTime"); var filteredInput = input as IStartDateOrientedFilter; if (filteredInput != null && filteredInput.StartDate.HasValue) { Expression originalExpression = null; var parameter = Expression.Parameter(typeof(TEntity), "p");
var dateConstantExpression = Expression.Constant(filteredInput.StartDate.Value, typeof(DateTime));
var propertyAccess = Expression.MakeMemberAccess(parameter, property); var expression = Expression.GreaterThanOrEqual(propertyAccess, dateConstantExpression);
var equalExpression = expression != null ? Expression.Lambda<Func<TEntity, bool>>(expression, parameter) : p => false;