Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8934755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:51:30+00:00 2026-06-15T09:51:30+00:00

I got an Object from Facebook SDK var responsePages = (JsonObject)FBClient_.Get(new { ids =

  • 0

I got an Object from Facebook SDK

var responsePages = (JsonObject)FBClient_.Get(new { ids = 
[123123123, 123123123, 12312213, etc]});

This query returns data (see image)

Results

Now how do I convert this into a list of objects?
I have tried following but it does not work

var pe = (from dynamic page
                in (IList<object>)(object)responsePages.Values
                             orderby page.name ascending
                             select new FBPage
                             {
                                 Id = Convert.ToString(page.id),
                             }
                ).ToList();

So that failed, would appreciate any help because this dynamic stuff drives me seriously mad.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:51:31+00:00Added an answer on June 15, 2026 at 9:51 am

    You don’t need to cast if you are using dynamic.

    var fb = new FacebookClient();
    
    dynamic result = fb.Get(new { ids = new[] { "...", "..." } });
    
    var pages = new List<FBPage>();
    foreach (var page in result.Values)
    {
        var fbPage = new FBPage {
            Id = page.id,
            Name = page.name
        };
    
        pages.Add(fbPage);
    }
    

    or if you want to use linq. (extension methods are not supported for dynamic, so you will need to do some casting, JsonObject => IDictionary<string, dyanmic>, JsonArray => IList<dynamic>)

    var pages = ((IDictionary<string, dynamic>)result)
        .Select(kpv => kpv.Value)
        .Select(p => new FBPage { id = p.id, name = p.name })
        .ToList();
    

    Or you strongly typed classes.

    var fbPages = fb.Get<IDictionary<string, FBPage>>(new { 
        ids = new[] { "...", "..." } 
    }).Values;
    
    public class FBPage
    {
        public string id { get; set; }
        public string name { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got an issue with deleting an object from ArrayList when working on the
I've got a custom control that gets bound to an object from view model.
I have a bytearray object in Python 2.7 that I got from a query
I'm trying to migrate from V5.3.2 to V6 of the SDK. I've got an
Say I somehow got an object reference from an other class: Object myObj =
How can I send a an object got it from a bean in a
If I have a Time object got from : Time.now and later I instantiate
I've got a class that receives an object from other unknown modules and so
So, I got this URL from Facebook: https://graph.facebook.com/cocacola If you open that up, the
After loading the Facebook C# SDK (FacebookWebMVC) library from NuGet, I followed exactly the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.