Example:
public class Name { public string FirstName { get; private set; } public string LastName { get; private set; } private Name() { } public Name(string firstName, string lastName) { FirstName = firstName; LastName = lastName; } }
When trying to instantiate this class, C # intellisense displays both the private and public constructor for the new keyword, although one of the constructors is private!
What's even weirder is that when I remove the second argument from the public constructor (delete lastName as an argument to the public constructor), intellisense now correctly only displays the public constructor with the new keyword.
Is this a mistake or am I missing something? I am using VS2008 SP1.
edit: code clarity
source share