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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:20:00+00:00 2026-05-23T00:20:00+00:00

I learn something new everyday about C# and came across this construct. I am

  • 0

I learn something new everyday about C# and came across this construct. I am not 100% sure what it does, so can someone please explain it:

new { Name = "John"}

This was used where a string was expected as an argument to a method call.

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-05-23T00:20:00+00:00Added an answer on May 23, 2026 at 12:20 am

    It’s an object initializer for an anonymous class. It constructs an object with a single property, Name, with value “John.” Since you have no way to refer to the object, you would use it right away, as in a LINQ statement or as a parameter as you mentioned.

    See also this answer.

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

Sidebar

Related Questions

Either this is a bug, or I'm about to learn something new about how
I just want to learn something new here about my code. I have the
I am trying to learn something about WPF and I am quite amazed by
I wanted to learn something about Spring and Maven, so I created sample Maven
I built a Testbox to learn something about threading in windows form applications. Silverlight
I learn best by taking apart something that already does something and figuring out
I know this is not a technical question, but this is something I believe
Note: I'm not completely sure if this question really belongs to StackOverflow so feel
I've started work on a new project, and I decided to also learn something
I'm trying to learn something about GUI, using NetBeans6.8, starting with the GUI section

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.