#811 – Extension Methods Can Only Access Public Members of Class

When you write an extension method to extend the behavior of an existing class, the code in your extension method has access only to the public members of the class being extended.  Even though the code that you are writing acts as a new instance method on the class, the code within your method has no special access to the members of the class beyond its public members.

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #811 – Extension Methods Can Only Access Public Members of Class

  1. Pingback: Dew Drop – March 29, 2013 (#1,517) | Alvin Ashcraft's Morning Dew

Leave a comment