Empty Queries

Jan 2, 2009 at 11:27 AM
Edited Jan 2, 2009 at 11:53 AM
I'm running a query to get photos by username, but my query is coming up blank on results.

I tried using a LINQ query I found in the source of the FlickrXplorer app, which is:
var query = (from ph in context.Photos
where ph.PhotoSize == PhotoSize.Square && ph.User == user && ph.SearchText == text
&& ph.Extras == (ExtrasOption.Views | ExtrasOption.Tags)
select ph).Take(pageLen).Skip(index);
I then tried making it as basic as I could, and it still isn't working.
var query = (from ph in context.Photos
where ph.User == user
select ph)
What am I missing?
Jan 4, 2009 at 6:52 AM
Edited Jan 4, 2009 at 6:52 AM


Did you put the filickr config section in app/web.config.

you can track error like this

context.Photos.OnError += new LinqExtender.Query<Photo>.ErrorHandler(<your handler>);

Please check the readme provided with the development pack in the relase section , it has few details.

Hope that helps,



Jan 5, 2009 at 10:05 AM
Edited Jan 5, 2009 at 10:42 AM
Turns out I was passing the NSID as the User, not the full username.

For my needs I am storing the reference to the user, so I can't use the username, as it could potentially change. How can I query by the NSID?

I'd also like some better instructions on how to handle authentication in a web app. After calling context.Authenticate(), the user logs in and is redirected back to the URL specified in the API key registration., but what should I be doing with the 'frob' that is returned in the Query String?

Also of note is that the ExtrasOption.Machine_Tags is not working. The Photo class from the Linq.Flickr namespace doesn't seem to have a property for the machine tags.
Jan 6, 2009 at 5:38 PM
Try out new patch in the release section that i have updated

var query = from photo in context.Photos
                   where photo.NsId == ''someId"
                    select photo;

there is another alternative way, where you first get people using NsId then pass it's username int photo.User.

Also, please check the readme provided in the Linq.Flickr.lib

There is authenticaton in flickr explorer you can take a look at it or try the following post


Hope that helps