London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
You could use something like: commentList= commentList.Where(x => x.UserEmail!=pageComment.UserEmail).ToList();
or
"commentList.RemoveAll(x => x.UserEmail == pageComment.UserEmail);" instead of "commentList = commentList.RemoveAll(x => x.UserEmail == pageComment.UserEmail);"
the int in the error is the number of elements removed from the list
This might not be a typical EPiServer question but i'm trying to remove items from a list using Linq but fails.
I have a Comment class with a string property called UserEmail
When someone adds a new comment and it's saved to DDS i send a email to those how has already commented on the same article but i don't want the person making the comment recive a mail. Like this:
List<PageComment> commentList;
commentList = GetComments(pageRef);
commentList = commentList.RemoveAll(x => x.UserEmail == pageComment.UserEmail);
The Linq expression gives this error:
Cannot implicitly convert type 'int' to 'System.Collections.Generic.List<PageComment>'
Why int? I'm dealing with strings here??
/David