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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:23:08+00:00 2026-06-14T11:23:08+00:00

I’m trying to get my head around this. I know about object initializers in

  • 0

I’m trying to get my head around this. I know about object initializers in recent versions of .Net but the code below confuses me. First is the calling code, and below that I’ve put the needed class and interface definitions.

var mockCustomer = new Customer_GetUserByCustIdResult();
var testSingleResult = new SingleResult<Customer_GetUserByCustIdResult> { mockCustomer };


public class SingleResult<T> : ISingleResult<T>
public interface ISingleResult<T> : IEnumerable<T>, IEnumerable, IFunctionResult, IDisposable

Using Visual Studio 2012’s intellisense I see that when newing up testSingleResult the mockCustomer class is treated as a return value—something to do with the IFunctionResult interface I believe. I’m not 100% sure how this is all working—rather than initializing member variables, we’re initializing a return value? That’s what it looks like anyway and I haven’t seen this before.

  • 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-14T11:23:11+00:00Added an answer on June 14, 2026 at 11:23 am

    What you’re looking at is a collection initializer, see: http://msdn.microsoft.com/en-us/library/bb384062.aspx

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

Sidebar

Related Questions

2 days I've been trying to get my head around this, but no joy.
Forgive the noob question, but I'm trying to get my head wrapped around this.
I'm just trying to get my head around this type of syntax I know
I am trying to get my head around this query - seems pretty straight
I can't wrap my head around this for some reason. I'm trying to get
I have been trying to wrap my head around why this is happening but
I am trying to get my head around some of my predecessors code who,
I've looked around but can't get my head around what I'm trying to do.
I am trying to get my head around ASP.NET 4.0 using C# as my
trying to get my head around Feedzirra here. I have it all setup and

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.