Summary 

In this chapter, we learned how to manage types in C#. We had a recap of the different data types available in C#. We did a deep dive into value and reference types in C#. We also had a review of the pointer data type and learned how it works. We had a look at some of the practices a user can use to choose the type of a variable. We had a look at generic types and learned how they help us to improve the performance of a system. 

Then, we looked at the different techniques we use to consume a type declared in C#. We learned how boxing and unboxing work in C#. We then had a look at how to we consume these data types. We also looked at type conversions, both implicit and explicit, and learned how they help us to convert one data type into another. 

Then, we had a look at Properties and how it helps us to have more control over setting and retrieving values from the field attributes of a class. Then, we worked on strings and learned how they work. We looked at the immutable nature of strings. We looked at using StringBuilder, StringWriter, and StringReader, which help us to improve the performance aspect of using strings. We then looked at the different functions in C# that help us to do different manipulation functions on a string. Finally, we did a high-level review of reflection and, using a code example, we learned how we can retrieve the metadata present in an assembly.

In the next chapter, we will look at how garbage collection is performed in C#. We will look at how the CLR manages memory for different data types in C#. We will look at how C# allows us to manage "unmanaged resources" or the "pointer types" that we saw in this chapter. We will also look at how we implement the IDisposable interface to manage unmanaged resources.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.241.116