SPS version 4.3.10.1
I am needing to iterate through an open Order's Notes and look at each Note's content for specific strings.
I have something like this, but the Cast to INote throws, as the items in the collection are not derived from INote.
Code: Select all
var notes = _activeOrder["Notes"] as IList;
var lookingForMyFavoriteNote = notes.Cast<INote>().FirstOrDefault(note =>
{
if (note.Content.StartsWith("this", StringComparison.InvariantCultureIgnoreCase) ||
note.Content..StartsWith("that", StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
return false;
}
?
Thank you.