Use the EFDataSource.Filters property to access an Entity Framework data source’s filters collection. This collection contains DBSetFilter objects that provide the settings required to filter a data source table.
The following code assigns a new filter string without referring to any parameters:
// ...
dataSource.Filters["Products"] = "ProductID = 1";
' ...
dataSource.Filters("Products") = "ProductID = 1"
The following code makes a filter string refer to a parameter:
//...
DBSetFilter filter = new DBSetFilter("Products", "ProductID = ?p1");
filter.Parameters.Add(new EFParameter("p1", typeof(int), 1));
dataSource.Filters.Add(filter);
Dim filter As New DBSetFilter("Products", "ProductID = ?p1")
filter.Parameters.Add(New EFParameter("p1", GetType(Integer), 1))
dataSource.Filters.Add(filter)