I need to get all vendorname if value(data.vendorname) is null its give an error Exception: "Value cannot be null."
public HttpResponseMessage PostFilter([FromBody] dynamic data)
{
    string[] vendorname = data.vendorname != null
                          ? data.vendorname.ToObject<string[]>()
                          : null;
    var items = (from s in context.AllInventories
                 where
                    (vendorname!=null
                     ? vendorname.Contains(s.VENDORNAME)
                     :1==1)
                 select s)
                 .Take(500)
                 .ToList();
}
 
     
    