Here is my code:
private bool GenericSummaryResultComparison
{
try
{
T oRiskRecord;
//Read in the result files.
oRiskRecord = SerializationMethods.DeserializeIt
foreach (T o in oRiskRecord)
{
// actions
}
return true;
}
catch (Exception ex)
{
throw new ArgumentException(ex.Message, ex.InnerException);
}
}
How can I get this iteration to work?
Thanks
Praneeth KumarPosted Jun 8, 2011, 6:54 AM
oRiskRecord = SerializationMethods.DeserializeIt
Mark MaguirePosted Jun 8, 2011, 6:43 AM
It still has the problem even with the GetEnumerator code in it.
Thanks
Mark
Praneeth KumarPosted Jun 8, 2011, 6:41 AM
Mark MaguirePosted Jun 8, 2011, 6:28 AM
I accidently submitted this one before i completed it.
Let me know if that helps you in anyway.
The code below is from the class object representing RiskRecord, it shows that I have incorporated IEnumerable and IEnumerator (NOTE: I have removed data properties from the RiskRecord class as it would be too long to include them).
Thanks
Mark
Praneeth KumarPosted Jun 8, 2011, 6:15 AM
{
// actions
}
In this line it throws error because oRiskRecord is not of type collection which is implementing IEnumerator. Can you post any sample project if you have?
Regards,
Praneeth
Jaganathan BantheswaranPosted Jun 8, 2011, 6:02 AM
Instead of T use "var".