public IEnumerable<InvalidSimContract> ValidateSims(SimSearchCriteriaContract searchCriteria)
{
var retval = new List<InvalidSimContract>();
VZWSuspendLogic obj = new VZWSuspendLogic();
var allowedSuspendDaysExpiredSims = searchCriteria.UserInputSims
.Where(s => obj.HasExpiredAllowedSuspendDays(s.SimId, searchCriteria.ServiceTypeId, searchCriteria.ToState.Id))
.Select(s => s.SimNumber).ToList();
if (allowedSuspendDaysExpiredSims != null)
{
return allowedSuspendDaysExpiredSims.Select((s, i) =>
new InvalidSimContract
{
Message = String.Format("Line {0} contains SIM Number :{1} has expired the maximum allowed suspension days for this year. Allowed suspension days for the year is {2} days.", i + 1,s, _allowedSuspendDaysInLast12Months),
UserInput = s,
ImeiNumber = string.Empty,
LineNumber = i + 1
}
).ToList();
}
return retval;
}
I want to print the index number of the filtered item as a line number. So how to get filter the index number too of the selected item.