tags:

views:

67

answers:

2

I want to do the following:

facebook.Schema.stream_data data = api.stream.get(null, new List<string> { page_id }, null, null, null, null);

But I get the following error:

Error 10 The best overloaded method match for 'facebook.stream.get(int, System.Collections.Generic.List, System.DateTime, System.DateTime, int, string)' has some invalid arguments Error 11 Argument '1': cannot convert from '<null>' to 'int'

Does anybody have any ideas on how to fix this?

A: 

Well, you can't convert null to an int - or indeed to a DateTime. You'll need to work out an actual value to pass in - you should be able to look at the API to find out what the default values are, and use those.

Alternatively, if you can use C# 4, you can just name the arguments you do want to pass in, and omit the rest.

Jon Skeet
The method is a wrapper for a facebook function that only requires some parameters. So, the only parameter I want to specify is the page_id... Is there another way to do this for besides for using C# 4?
rksprst
Yes - just find out what the default values are for the parameters you don't want to use, and pass them in.
Jon Skeet
A: 

I ended up solving this problem by upgrading to version 3 of the facebook developers toolkit api. The new version allows me to send null to facebook (which is what facebook expects).

rksprst