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 462401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:04:15+00:00 2026-05-12T23:04:15+00:00

I am trying to do the following: Given TypeInfo after reflecting on a LINQ-to-SQL

  • 0

I am trying to do the following:

  1. Given TypeInfo after reflecting on a LINQ-to-SQL object with various EntitySet<> child collections, retrieve the collection
  2. Do some operations on the collection

The code below does not compile, obviously – just looking for another way to do this [Note, “Facade” is the L2S object in question). The things that don’t compile are the usages of “itemType” becuase it’s a variable, not a Type name, but you get the idea:

//itemType is the reflected Type of child object

EntitySet<itemType> list = (EntitySet<itemType>)type.InvokeMember(
                                       info.Name,
                                       BindingFlags.GetProperty,
                                       null,
                                       Facade,
                                       null);


foreach (itemType o in list)
    //do something with o

The closest possible dupe I come up with is here, but there is no ultimate solution.

Thanks in advance for any ideas.

  • 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-05-12T23:04:15+00:00Added an answer on May 12, 2026 at 11:04 pm

    Okay, this works:

    var list = type.InvokeMember(
                                 info.Name,
                                 BindingFlags.GetProperty,
                                 null,
                                 Facade,
                                 null);
    
    IEnumerable e = list as IEnumerable;
    
    if (e == null)
        continue;
    
    foreach (object o in e)
        //do stuff with o
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to do some Cucumber testing like the following: Given I am
I am trying to leverage ORM given the following requirements: 1) Using .NET Framework
I'm trying to solve the following problem: Given an input of, say, 0000000000000000 0011111111110000
I'm trying to determine whether Object1 will collide with Object2 given the following information:
I am trying to figure this out, given the following code, does the Refresh()
I'm trying to achieve the following: Given an abstract class MemoryObject , that every
I am trying to connect MySQL to Windows following the instructions given here .
Have noticed the following behaviour when trying to compare two doubles. Given the following
Given the following SQL: IF EXISTS (SELECT * FROM sys.columns WHERE name = 'NewFieldName'
Given the following Xml: <record> <category>Sport/Racket Sports/Tennis</category> <category>Sport/Racket Sports/Badminton</category> </record> I'm trying to break

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.