Hi Guys,
I just wondering if i can re filter the collection based on the following code.
so i would like to do something like this in linq if possible:
EntityCollection<VwProjectCollectionEntity> collection= GetProjectData();
var workplan = (from collection where....
in sql query: select description from collection where title='test';
Please advise if that is possible. if it is possible
public void Generate()
{
ArrayList pgnodes = new ArrayList();
EntityCollection<VwProjectCollectionEntity> collection = GetProjectData();
}
private EntityCollection<VwProjectCollectionEntity> GetProjectData()
{
EntityCollection<VwProjectCollectionEntity> collection = new EntityCollection<VwProjectCollectionEntity>();
DataAccessAdapter aAdaptor = clsDatabaseMethods.GetNewAdapter();
IPrefetchPath2 path = new PrefetchPath2(EntityType.VwProjectCollectionEntity);
RelationPredicateBucket bucketbucket = new RelationPredicateBucket();
//The following will check if the Show Completed only checkbox is checked or not
if (chkShowCompleted.Checked)
{
bucketbucket.PredicateExpression.Add(VwProjectCollectionFields.DateCompleted != System.DBNull.Value);
}
else
{
bucketbucket.PredicateExpression.Add(VwProjectCollectionFields.DateCompleted == System.DBNull.Value);
}
//Add in predicate from search criteria
if (bucket != null)
{
Int32 count = 0;
while (count < bucket.Count)
{
bucketbucket.PredicateExpression.Add(bucket[count]);
count += 1;
}
}
SortExpression sort = new SortExpression();
//Sorting by LastName
ISortExpression aSortExpression = new SortExpression(VwProjectCollectionFields.LastName | SortOperator.Ascending);
//Using the StartDateOrder to make sure CommunicateionStartDate order ASC and put the null date in buttom
aSortExpression.Add(VwProjectCollectionFields.StartDateOrder | SortOperator.Ascending);
aSortExpression.Add(VwProjectCollectionFields.CommunicationStartDate | SortOperator.Ascending);
aAdaptor.FetchEntityCollection(collection, bucketbucket, 0, aSortExpression, path);
return collection;
}