Click here to Skip to main content
15,920,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: Access a combobox defined in datatemplate Pin
Hervend20-Dec-17 22:45
Hervend20-Dec-17 22:45 
GeneralRe: Access a combobox defined in datatemplate Pin
Pete O'Hanlon20-Dec-17 23:15
mvePete O'Hanlon20-Dec-17 23:15 
GeneralRe: Access a combobox defined in datatemplate Pin
Hervend21-Dec-17 0:02
Hervend21-Dec-17 0:02 
QuestionLinq to Update multiple fields in the list Pin
Member 984545419-Dec-17 20:36
Member 984545419-Dec-17 20:36 
AnswerRe: Linq to Update multiple fields in the list Pin
Richard Deeming20-Dec-17 2:29
mveRichard Deeming20-Dec-17 2:29 
QuestionRe: Linq to Update multiple fields in the list Pin
Gerry Schmitz20-Dec-17 4:37
mveGerry Schmitz20-Dec-17 4:37 
Questionc sharp windows form application in visual studio Pin
Member 1358596919-Dec-17 20:30
Member 1358596919-Dec-17 20:30 
AnswerRe: c sharp windows form application in visual studio Pin
OriginalGriff19-Dec-17 21:38
mveOriginalGriff19-Dec-17 21:38 
QuestionHow to speech russian text in C#? Pin
Ldta19-Dec-17 15:38
Ldta19-Dec-17 15:38 
AnswerRe: How to speech russian text in C#? Pin
Pete O'Hanlon19-Dec-17 19:35
mvePete O'Hanlon19-Dec-17 19:35 
GeneralRe: How to speech russian text in C#? Pin
Ldta20-Dec-17 1:43
Ldta20-Dec-17 1:43 
GeneralRe: How to speech russian text in C#? Pin
Pete O'Hanlon20-Dec-17 2:43
mvePete O'Hanlon20-Dec-17 2:43 
QuestionDrag and drop dynamically a video from a media player to another container Pin
Hervend19-Dec-17 0:19
Hervend19-Dec-17 0:19 
AnswerRe: Drag and drop dynamically a video from a media player to another container Pin
Richard MacCutchan19-Dec-17 2:48
mveRichard MacCutchan19-Dec-17 2:48 
GeneralRe: Drag and drop dynamically a video from a media player to another container Pin
Hervend19-Dec-17 20:37
Hervend19-Dec-17 20:37 
Questionsave appointment on the shared exchange calendar Pin
maxim^18-Dec-17 23:22
maxim^18-Dec-17 23:22 
AnswerRe: save appointment on the shared exchange calendar Pin
OriginalGriff18-Dec-17 23:26
mveOriginalGriff18-Dec-17 23:26 
AnswerRe: save appointment on the shared exchange calendar Pin
Pete O'Hanlon19-Dec-17 4:03
mvePete O'Hanlon19-Dec-17 4:03 
Questionlambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Krellon18-Dec-17 23:02
Krellon18-Dec-17 23:02 
AnswerRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
OriginalGriff18-Dec-17 23:25
mveOriginalGriff18-Dec-17 23:25 
GeneralRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Krellon19-Dec-17 0:13
Krellon19-Dec-17 0:13 
GeneralRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Richard Deeming19-Dec-17 2:19
mveRichard Deeming19-Dec-17 2:19 
GeneralRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Krellon19-Dec-17 5:37
Krellon19-Dec-17 5:37 
Hi Homer, I thought the query might return all results in the collection where value == 802.11g and Object2 wasn't equal to null. I have so much to learn Smile | :)

I did a test run and you were right! all objects came back in the collection.

I have since implemented your recommendation and that worked Smile | :)

Here's my test code for ref.

using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp3
{
  class Program
  {
    static void Main(string[] args)
    {
      List<Object1> origCollection = new List<Object1>()
        {
          new Object1() {ID = 1, theList = new List<Object2>()
            {
              new Object2() { Name = "Mode", Value = "802.11b" },
              new Object2() { Name = "BW", Value = "20" },
              new Object2() { Name = "Chan", Value = "1" },
              new Object2() { Name = "Tech", Value = "SISO" }
            }
          },
          new Object1() { ID = 2, theList = new List<Object2>()
            {
              new Object2(){ Name = "Mode", Value = "802.11g" },
              new Object2(){ Name = "BW", Value = "20" },
              new Object2(){ Name = "Chan", Value = "1" },
              new Object2(){ Name = "Tech", Value = "SISO" }
            }
          }   
        };

        var theCollection0 = origCollection.Where(m => m.theList.Select(n => n.Value == "802.11b") != null); // Broken

        var theCollection1 = origCollection.Where(m => m.theList.Any(n => n.Value == "802.11b"));            // Works!
        var theCollection3 = origCollection.Where(m => m.theList.Any(n => n.Value == "802.11z"));            // Returns Empty as expected.
    }
  };


  class Object1
  {
    public int ID { get; set; }
    public List<Object2> theList; 
  }

  class Object2
  {
    public string Name { get; set; }
    public string Value { get; set; }
  }
}


Many thanks for spotting and fixing this! your a star Smile | :)

Br
Nigel
SuggestionRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
Richard Deeming19-Dec-17 2:17
mveRichard Deeming19-Dec-17 2:17 
GeneralRe: lambda expression to retrieve sequence based on an array value where the array is stored in the sequence Pin
OriginalGriff19-Dec-17 2:26
mveOriginalGriff19-Dec-17 2:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.