0

I just started reading about WCF. In the book the author has mentioned :

The ServiceContract attribute maps a CLR interface/class as a WCF contract independently of that type's visibility.

How is this possible? The explanation given was:

The type visibility has no bearing on WCF, because visibility is a CLR concept.

I really don't understand how this is possible. Can someone please explain?

Jeroen
  • 60,696
  • 40
  • 206
  • 339
Sat
  • 161
  • 1
  • 2
  • 8
  • I recognized the quote (I think) from Juval Lowy's book. I edited your question a bit, including a few minor updates to the quotes (using the book). Hopefully this improved the question, but if you feel I changed the semantics of your question for the worse feel free to revert my edits. – Jeroen Sep 08 '12 at 09:34

1 Answers1

0

Regardless of the type's CLR visibility, WCF can retrieve attribute information to find out that in fact it's dealing with a contract, and similarly find out which operations that contract has. WCF can then decide to make that contract and its operations public (as in "publicize", not "CLR-public"), regardless of the CLR-visibility of the underlying type.

Note: Given the trend with ASP.NET and MVC, the call for open sourcing WCF may succeed at some time in the future. If that happens it may help to update this answer and add a link to or quote from the various implementations to further illustrate this.

Jeroen
  • 60,696
  • 40
  • 206
  • 339