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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:53:57+00:00 2026-06-06T18:53:57+00:00

C# 4 introduced a feature called named arguments which is especially useful in scenarios

  • 0

C# 4 introduced a feature called named arguments which is especially useful in scenarios like

int RegisterUser(string nameFirst, string nameLast, string nameMiddle, string email)

Is there a way to force using named arguments? Maybe some attribute to apply to a method or a compiler switch I’m not aware of? I guess it can be done with code inspector tools but just want to know if there is other way.

p.s.

For those interested why one may need it and why not just use a class/struct to utilize object initializers there are scenarios when it’s impossible. Like calls to libraries not in your control or weird code conventions you have to obey.

  • 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-06T18:53:59+00:00Added an answer on June 6, 2026 at 6:53 pm

    No, not in the C# language. It will always accept positional parameters if all the parameters are supplied.

    You could build a custom FxCop rule or an StyleCop rule to enforce this – as pointed out in the comments, it is likely a StyleCop rule you would be interested in (thanks to Kris).

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

Sidebar

Related Questions

C# 2 and VB.Net 8 introduced a new feature called iterators , which were
Google Chrome 17 introduced a new feature which preloads a webpage to improve rendering
.NET 4 introduced Code Contracts as a new feature. I'd like to use CC,
Lifemojo.com has introduced a new feature through which you can access the calorie content
I have recently been introduced to the new Access 2007 feature which is multivalued
I've heard that iOS 5 introduced a feature in which the iOS device can
I'm trying to utilize the parameter feature introduced in the v4 release, but I'm
SQL Server 2012 introduced Sequence as a new feature, same as in Oracle and
I would like to introduce multithreading feature in my shell script. I have a
I introduced a mapping for a business object which has (among others) a property

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.