Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Functional C#

You're reading from   Functional C# Uncover the secrets of functional programming using C# and change the way you approach your applications

Arrow left icon
Product type Paperback
Published in Dec 2016
Publisher Packt
ISBN-13 9781785282225
Length 370 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Wisnu Anggoro Wisnu Anggoro
Author Profile Icon Wisnu Anggoro
Wisnu Anggoro
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Tasting Functional Style in C# 2. Walkthrough Delegates FREE CHAPTER 3. Expressing Anonymous Methods with Lambda Expressions 4. Extending Object Functionality with Extension Methods 5. Querying Any Collection Easily with LINQ 6. Enhancing the Responsiveness of the Functional Program with Asynchronous Programming 7. Learning Recursion 8. Optimizing the Code using Laziness and Caching Techniques 9. Working with Pattern 10. Taking an Action in C# Functional Programming 11. Coding Best Practice and Testing the Functional Code

Preparing the C# compiler

For the rest of the discussion in this chapter, we are going to create some code in C#. In order we have the same environment, let's define what we will use in configuration settings. We will use Visual Studio 2015 Community Edition and .NET Framework 4.6.2 in all of the source code we discuss in this book. We will also choose the console application project in order to ease the development of our code since it doesn't need many changes to the settings.

Here is the screenshot of the setting in creating Visual Studio projects we will use:

Preparing the C# compiler

When we are discussing a source code that has a csproj filename-for instance, FuncObject.csproj-we can find it in one of solution files provided in the sample code. It will be in the Program.cs file. The following is a screenshot of the structure of the project in Visual Studio:

Preparing the C# compiler

However, sometimes, we have more than one .cs file inside the project file. In this case, we can find the code we are discussing in one of the .cs files inside the project file. For instance, we have a project file named FunctionalCode.csproj. So, when we discuss any source code related to this project file, we can find it from the .cs files inside the project file. The structure of a project file consisting of more than one .cs files is as follows:

Preparing the C# compiler

As we can see, inside the FunctionalCode.csproj file, not only do we have the Program.cs file, but also Disposable.cs, FunctionalExtension.cs, StringBuilderExtension.cs, and Utility.cs.

We will also find the partial keyword to the classes name in most of our code even though we write the classes in the same file. The purpose is to make the code snippet in this book easy to find in the sample code. By knowing the class name, it will be easier to find the source code in the file.

Note

We also need to install Visual Studio Community 2017 RC since we will use a new feature of C# 7 in Chapter 9, Working with Pattern.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image