/// <inheritdoc /> protected internal override IEnumerable <PostEntry> BuildPostData() { var selectedItems = SelectedItems; if (selectedItems.Count == 0) { yield break; } if (IsDropDown) { // Return only the last item var lastEntry = selectedItems.Last(); var postEntry = new PostEntry(Name, lastEntry.PostValue); yield return(postEntry); } else { foreach (var selectedItem in selectedItems) { var postEntry = new PostEntry(Name, selectedItem.PostValue); yield return(postEntry); } } }
/// <inheritdoc /> protected internal override IEnumerable<PostEntry> BuildPostData() { var selectedItems = SelectedItems; if (selectedItems.Count == 0) { yield break; } if (IsDropDown) { // Return only the last item var lastEntry = selectedItems.Last(); var postEntry = new PostEntry(Name, lastEntry.PostValue); yield return postEntry; } else { foreach (var selectedItem in selectedItems) { var postEntry = new PostEntry(Name, selectedItem.PostValue); yield return postEntry; } } }