Question: my code:

```
    namespace Reflection

    {

    class Program
    {
        static void Main(string[] args)
        {
            Type t = typeof(Product);
            PropertyInfo[] proInfo = t.GetProperties();
            foreach (var item in proInfo)
            {
                Console.WriteLine(item.Name);
            }
        }
    }
    public class Product
    {

        public int ProId { get; set; }
        public string ProName { get; set; }
        public string Description { get; set; }
        public decimal UnitPrice { get; set; }
    }

```

I get all properties names as output.But I dont want to show ProId and Decription in the output .How can i do that????

Answer: 
```
var MyIernumerableOfAnonymouseTypes = 
   lstCommanders.Select(c => new { 
                    theCommander = c, 
                    theToolName = c.lstSoldiers.Where(s => s.IsCanWinWar)
                                               .Select(s => s.Tool)
                                               .FirstOrDefault() })
                .Where(x => x.theToolName != null);

```

If there is no soldier which can win war, then tool will be null. Just filter out those commanders after selection.

BTW I think `Soldiers` is a better property name, then `lstSoldiers` (it has no prefix and it is PascalCase).
First approach (revised later): 

```
from commander in lstCommanders
where commander.lstSoldiers.Any(soldier => soldier.IsCanWinWar) // Consider only commanders who have at least one soldier who can win the war
select new
            {
                Commander = commander,
                Tool = (from soldier in commander.lstSoldiers
                        where soldier.IsCanWinWar // Consider tool originating from soldiers who can win the war
                        select soldier.Tool).FirstOrDefault()
            };

```

Second more concise and faster:

```
from commander in lstCommanders
where commander.lstSoldiers.Any(soldier => soldier.IsCanWinWar)
select new { Commander = commander, Tool = commander.lstSoldiers.First(soldier => soldier.IsCanWinWar).Tool };

```

In the fluent way: 

```
lstCommanders.Where(commander => commander.lstSoldiers.Any(soldier => soldier.IsCanWinWar))
             .Select(  commander => new
                                         {
                                                 Commander = commander,
                                                 Tool = commander.lstSoldiers.First(soldier => soldier.IsCanWinWar).Tool
                                         });

```

Third option with one iteration:

```
from commander in lstCommanders
let winner = commander.lstSoldiers.FirstOrDefault(soldier => soldier.IsCanWinWar)
where null != winner // Consider only commanders who have at least one soldier who can win the war
select new { Commander = commander, Tool = winner.Tool };

```