You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,53 @@
|
||||
namespace System.Web.UI.WebControls.Expressions {
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
|
||||
[
|
||||
ParseChildren(true, "Expressions"),
|
||||
PersistChildren(false)
|
||||
]
|
||||
public class QueryExpression {
|
||||
private HttpContext _context;
|
||||
private Control _owner;
|
||||
private IQueryableDataSource _dataSource;
|
||||
private DataSourceExpressionCollection _expressions;
|
||||
|
||||
[
|
||||
PersistenceMode(PersistenceMode.InnerDefaultProperty)
|
||||
]
|
||||
public DataSourceExpressionCollection Expressions {
|
||||
get {
|
||||
if (_expressions == null) {
|
||||
_expressions = new DataSourceExpressionCollection();
|
||||
}
|
||||
return _expressions;
|
||||
}
|
||||
}
|
||||
|
||||
public void Initialize(Control owner, HttpContext context, IQueryableDataSource dataSource) {
|
||||
_owner = owner;
|
||||
_context = context;
|
||||
_dataSource = dataSource;
|
||||
|
||||
Expressions.SetContext(owner, context, dataSource);
|
||||
}
|
||||
|
||||
public virtual IQueryable GetQueryable(IQueryable source) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach (DataSourceExpression e in Expressions) {
|
||||
source = e.GetQueryable(source) ?? source;
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user