mathew_s
asked on
Convert List to IENumerable Collection
I am getting an error in the DataProvider.TmpOpps.Load( TmpOppList 3) that there is some invalid argument.
The commented out piece of code works //DataProvider.TmpOpps.Loa d(e.Result .TargetLis t);
The lines with comments of NEW are ones that I put in trying to get it to work. What I wanted to do is filter the dataset before passing it to the load but am having a difficult time figuring this out. Any help?
The commented out piece of code works //DataProvider.TmpOpps.Loa
The lines with comments of NEW are ones that I put in trying to get it to work. What I wanted to do is filter the dataset before passing it to the load but am having a difficult time figuring this out. Any help?
void _client_TemporaryOpportunityDeploymentServiceCompleted(object sender, TemporaryOpportunityDeploymentServiceCompletedEventArgs e)
{
switch (e.Result.Operation)
{
case Operations.CommonGetAll:
ObservableCollection<TemporaryOpportunityDeployment> TmpOppList2 = new ObservableCollection<TemporaryOpportunityDeployment>(); //*NEW
TmpOppList2 = e.Result.TargetList; //*NEW
var TmpOppList3 = TmpOppList2.Where(x => x.OppEndDate>DateTime.Now); //*NEW
if (e.Result.Succeeded) DataProvider.TmpOpps.Load(TmpOppList3); //DataProvider.TmpOpps.Load(e.Result.TargetList); //*NEW
else { _refreshFailed = true; _refreshErrors.Add(e.Result.ErrorMessage); }
FinishSetAndCheckCompletion(DataSets.TmpOpps);
break;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.