title: C# Create object with dynamic properties : LINQ select List<object> values by property names array
body: <pre><code>class OriginalObject
          {
              public string str1  {get;set;}
              public string str2 { get; set; }
              public string str3 { get; set; }
              public string str4 { get; set; }
  
          }
          class Program
          {
              static void Main(string[] args)
              {           
  
                  List&lt;OriginalObject&gt; obj = new List&lt;OriginalObject&gt;();
                  obj.Add(new OriginalObject()
                  {
                      str1 ="hi",
                      str2 = "hello",
                      str3 = "how",
                      str4 = "r u"
                  });
  
                  obj.Add(new OriginalObject()
                  {
                      str1 = "i",
                      str2 = "am",
                      str3 = "fine",
                      str4 = "great"
                  });
  
                  var PropertyNames = new[] { "str1","str4"};
  
               //var result = Select from obj only column names that present in PropertyName Array 
                  // Expected
                  //obj ---&gt;
                  //          {str1 = "hi",str4="r u"}
                  //          {str1 = "i",str4="great"}
  
  
              }
          }   
  </code></pre>