Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
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 (19) Chapters Close

Functional C#
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Tasting Functional Style in C# FREE CHAPTER 2. Walkthrough Delegates 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

Summary


LINQ has made our task of querying a collection easier because we don't need to learn much syntax to access different types of collections. It implements a deferred execution concept, which means that the query will not be executed in the constructor time but in the enumeration process. Almost all query operators provide the deferred execution concept; however, there are exceptions for the operators that do the following:

Return a scalar value or single element, such as Count and First.

Convert the result of query; they are ToList, ToArray, ToDictionary, and ToLookup. They are also called conversion operators.

In other words, methods that return a sequence implement deferred execution for instance, the Select method (IEnumerable<X>-> Select -> IEnumerable<Y>) and methods that return a single object don't implement deferred execution, for instance, the First method (IEnumerable<X>-> First -> Y).

There are two types of LINQ querying syntaxes; they are the...

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 $15.99/month. Cancel anytime
Visually different images