title: Linq to Sql - return all data if 'contains' value is null in where clause
body: <p>I need to get all vendorname if value(data.vendorname) is null its give an error  Exception: "Value cannot be null."</p>
  
  <pre><code>public HttpResponseMessage PostFilter([FromBody] dynamic data)
  {
      string[] vendorname = data.vendorname != null
                            ? data.vendorname.ToObject&lt;string[]&gt;()
                            : null;
  
      var items = (from s in context.AllInventories
                   where
                      (vendorname!=null
                       ? vendorname.Contains(s.VENDORNAME)
                       :1==1)
                   select s)
                   .Take(500)
                   .ToList();
  }
  </code></pre>