Unable to initialize the automatic property in C#.

Posted by isthatacode on Stack Overflow See other posts from Stack Overflow or by isthatacode
Published on 2010-04-06T14:21:41Z Indexed on 2010/04/06 14:23 UTC
Read the original article Hit count: 195

Filed under:
|
|
|

I have an automatic property

public bool HasToolkit { get; set; }

when i try to initialize it like this-

Tandem t = new Tandem(GearCount = 5);

It gives an error as below

The name 'GearCount' does not exist in the current context

Whats wrong here ? Also if i do normal intantiation it works fine. Tandem t = new Tandem();

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about 3.5