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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:21:44+00:00 2026-05-23T08:21:44+00:00

What is this Type in .NET? I am using reflection to get a list

  • 0

What is this Type in .NET? I am using reflection to get a list of all the classes and this one turns up.

What is it? where does it come from? How is the name DisplayClass1 chosen? I search the sources and didnt see anything. What does the <> mean? what does the c__ mean? is there reference?

enter image description here

  • 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-23T08:21:44+00:00Added an answer on May 23, 2026 at 8:21 am

    It’s almost certainly a class generated by the compiler due to a lambda expression or anonymous method. For example, consider this code:

    using System;
    
    class Test
    {
        static void Main()
        {
            int x = 10;
            Func<int, int> foo = y => y + x;
            Console.WriteLine(foo(x));
        }
    }
    

    That gets compiled into:

    using System;
    
    class Test
    {
        static void Main()
        {
            ExtraClass extra = new ExtraClass();
            extra.x = 10;
    
            Func<int, int> foo = extra.DelegateMethod;
            Console.WriteLine(foo(x));
        }
    
        private class ExtraClass
        {
            public int x;
    
            public int DelegateMethod(int y)
            {
                return y + x;
            }
        }
    }
    

    … except using <>c_displayClass1 as the name instead of ExtraClass. This is an unspeakable name in that it isn’t valid C# – which means the C# compiler knows for sure that it won’t appear in your own code and clash with its choice.

    The exact manner of compiling anonymous functions is implementation-specific, of course – as is the choice of name for the extra class.

    The compiler also generates extra classes for iterator blocks and (in C# 5) async methods and delegates.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using reflection to get an object's type, or for this issue an
Is there any way to clean up this type of loop using LINQ? List<Car>
Is there any way to using reflection in .net to get a property's value
I'm using this code in ASP.NET MVC 2 preview 1: public ActionResult List(long id,
Using reflection, how can I get all types that implement an interface with C#
In .NET, strings are immutable and are reference type variables. This often comes as
I'm trying this: Type ThreadContextType = typeof(Application).GetNestedType(ThreadContext, System.Reflection.BindingFlags.NonPublic); MethodInfo FDoIdleMi = ThreadContextType.GetMethod(FDoIdle, BindingFlags.NonPublic |
I'm trying to get my company to move to ASP.NET MVC and away from
I use the .NET Entity Framework. I want to copy properties from one EntityObject
using System; using System.Reflection; namespace A { interface IObjectWithId<TId> { TId Id { get;

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.