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

The Archive Base Latest Questions

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

Saw something like this in a lazily loaded property getter: public SomeClass SomeProperty {

  • 0

Saw something like this in a lazily loaded property getter:

public SomeClass SomeProperty
{
    get
    {
        return _someVar ?? (_someVar = new SomeClass());
    }
}

Seems kind of obvious to me what is going on, I just managed to get by using C# for years now without noticing this would work:

int i = 0;
(i = 1).GetType();

I guess my primary question is, does this have some kind of special name I could use to search for more information about it/describe it to others? I guess I’m mostly curious if there are any gotchas associated with it (order of execution, etc, similar to what you’d have to think of when linking multiple null coalescing operators together), or if there are any other standard uses of this like the lazily loaded property getter seen above (even though I don’t think it’s particularly clean compared to the alternatives).

I’m almost embarrassed to post this since it seems like something that would be pretty hard to not have thought about/seen before, haha. Thanks in advance.

  • 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:53:48+00:00Added an answer on June 15, 2026 at 9:53 am

    This is just a consequence of assignment being an expression in C#. From the C# specification:

    The result of a simple assignment expression is the value assigned to
    the left operand. The result has the same type as the left operand and
    is always classified as a value.

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

Sidebar

Related Questions

I saw something like this today: frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) {
I saw a java function that looked something like this- public static<T> foo() {...}
I recently saw a C# constructor that look something like this... public Class foo
I've been examining HTTP 1.1 specifications and well I saw something like this: Request-Line
I was going through Apple's documentation and I saw something like this (void (^)(void))
I saw some code written by another developer that looks something like this: var
I saw something like this in Javascript : function name (secret) { secret =
I was checking out some sample codes and I saw something like this: @(Html.DataList<ProductOverviewModel>(Model,
below is a dummy function. i saw something like this somewhere. i didnt understand
I always thought I knew C very well until I saw something like this

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.