cogumel0
cogumel0

Reputation: 2671

Creating Powershell CmdLets in C# - why not use auto-implemented properties

Very simple question:

In all of the examples I've seen, cmdlets never take advantage of auto-implemented properties for the cmdlet parameters, is there any genuine reason for not using auto-implemented properties?

Upvotes: 1

Views: 137

Answers (1)

Mike Zboray
Mike Zboray

Reputation: 40818

I don't think there's any reason why you couldn't use auto-implemented properties. I have and it seems to work fine. My guess would be that a lot of example code was just written pre-C# 3.0 and they had to do it by hand.

Upvotes: 2

Related Questions