CHAPTER 4

images

Methods

This chapter will discuss the following C# methods: instance, static, anonymous, and extension. In doing so, you’ll learn how the this keyword relates to these methods and how the CLR passes value for the this keyword used as parameter in runtime by examining data on the stack.

You will also explore how the anonymous method works when there is external variable reference in it and when there is no external variable referenced from it. Additionally, you will find out how the this keyword is used in both circumstances.

Finally, you will learn about the compile time and runtime behavior of the extension methods and how the C# compiler ...

Get Expert C# 5.0: with the .NET 4.5 Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.