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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:58:43+00:00 2026-05-14T05:58:43+00:00

Can you please tell me what kind of construct in C# is this. Code

  • 0

Can you please tell me what kind of construct in C# is this.

Code Golf: Numeric equivalent of an Excel column name

C.WriteLine(C.ReadLine() 
            .Reverse() 
            .Select((c, i) => (c - 64) * System.Math.Pow(26, i)) 
            .Sum());

Though I am new to C# (only two months exp so far), but since the time I have joined a C# team, I have never seen this kind of chaining. It really attracted me and I want to learn more about it.

Please give some insight about this.

  • 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-14T05:58:44+00:00Added an answer on May 14, 2026 at 5:58 am

    Method chaining like this is often called a fluent interface.

    You can make your own fluent interface by implementing functions that return the object they were called on.

    For a trivial example:

    class Foo 
    {
        private int bar;
    
        public Foo AddBar(int b) 
        {
            bar += b;
            return this;
        }
    }
    

    Which can be used like:

    Foo f = new Foo().AddBar(1).AddBar(2);
    

    You could also implement a fluent interface using extension methods.

    For example:

    class Foo 
    {
        public int Bar { get; set; }
    }
    
    static class FooExtensions 
    {
        public static Foo AddBar(this Foo foo, int b)
        {
            foo.Bar += b;
            return foo;
        }
    }
    

    etc.

    Here is a more complex example. Finally, Autofac and CuttingEdge.Conditons are two examples of open-source libraries that have very nice fluent interfaces.

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

Sidebar

Related Questions

Please Anyone can tell me why i got this kind of error: ACK=Failure&L_ERRORCODE0=81002&L_SHORTMESSAGE0=Unspecified%20Method&L_LONGMESSAGE0=Method%20Specified%20is%20not%20Supported&L_SEVERITYCODE0=Error
Can someone please tell me why this doesn't work? I'm trying to show and
Can someone please tell me how I can implement the following line of pseudo-code.
Could someone please be so kind and tell me how I can hide the
Can anyone please tell what is change request management tool and what is involved
Can anyone please tell me why compiling a C# application with a .cs file
Can you please tell me how can I set a global #define in my
Can anyone please tell me when should I use MessageContracts and when should I
Can anybody please tell me what is the use of %NOTFOUND operator? We can
Can someone please tell me ehy in IE 6 div is not in center.

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.