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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:00:32+00:00 2026-06-15T00:00:32+00:00

I have a set of so called fluent interfaces, so I can use syntax

  • 0

I have a set of so called fluent interfaces, so I can use syntax like this:

a.With(“abc”).Do(“this”).Then(“that);

Each method returns an object cast to a corresponding interface. At design time I can use Intellisense to easily navigate between API methods. However I can no longer do it if I cast one of the arguments to a dynamic:

a.With((dynamic)”abc”).Do(“this”).Then(“that);

Not only I lose Intellisense at design time, this cast affects runtime execution: all subsequent calls after With return objects of a dynamic type potentially breaking the execution logic.

What I fail to understand is why should a dynamic argument affect contracts that only use static types. If a method With is designed to return an instance of ISomeInterface and the implementation returns SomeClass (that implements ISomeInterface), why should a dynamic object used in unrelated place infect all subsequent call chain? Is there any way to prevent it?

  • 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-15T00:00:33+00:00Added an answer on June 15, 2026 at 12:00 am

    I believe this post by Erik Lippert answer it all:

    http://blogs.msdn.com/b/ericlippert/archive/2012/10/22/a-method-group-of-one.aspx

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

Sidebar

Related Questions

I have set up a JUnit test that is testing a method called copy(File
I have a case that looks like this: I have a collection called for
I have a set of directories called CODE (GRADE) and would like to rename
I have a large real 1-d data set called r. I would like plot:
I have a set of five functions, that could be called one of five
I have set up a UDP client/server model that can send string messages to
I have a set called ISET; with a long list of 3-letter elements like:
I have this query: UPDATE phonecalls SET Called = Yes WHERE PhoneNumber = 999
So I have set up on my server a page that will be called
Hi i have a table called 'BookPage' with column: 'PageText' i have set up

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.