I am trying to instantiate a List with just a string for each list item. I am using the Google APIs library for their Prediction API, and when I go to set the input body (InputValue.CsvInstance), it is expecting a type of IList.
InputValue.CsvInstance is a virtual IList and is described as a list of input features which can be strings or doubles.
var body = new Google.Apis.Prediction.v1_6.Data.Input();
IList<string> list = new List<string>();
list.Add("this is some text in english!");
body.InputValue.CsvInstance = (IList<object>)list; //fails here
I have tried creating just IList, but I get an invalid cast exception when trying to cast it to IList.
I have tried creating a IList, and populating it with strings, but at runtime it throws a Null exception error.
Can someone please provide me an example of how I would create this IList so I can set the CsvInstance?
EDIT: So I'm not sure this has to do with how I am creating the List<>. I'm thinking I'm not using the client library properly.
I'm trying to call this function: PredictRequest
It seems like the body of the request needs to be of type Google.Apis.Prediction.v1_6.Data.Input() and that's where I am running into issues setting the InputValue.CsvInstance: InputValue