Skip to main content

Chapter 10: LINQ and functional programming

In this chapter

  • 10.1 Sequences and enumerators
    • What is a sequence?
    • IEnumerable<T> and IEnumerator<T>
  • 10.2 Iterators
    • The magic of yield return
    • Deferred execution
    • yield break
    • Decorator sequences: a conceptual model for deferred execution
    • Pitfall guide: multiple enumeration
    • Variable capture and loop pitfalls
  • 10.3 LINQ query syntax
    • Query syntax: SQL-like
    • Method syntax: extension method chaining
    • Compiler transformation
  • 10.4 Common LINQ operators
    • Filtering
    • Ordering
    • Projection
    • Finding a single element
    • Quantification and aggregation
    • Set operations
    • Grouping
    • Pairing
    • Joining sequences by key: inner and outer joins
  • 10.5 LINQ Providers and IQueryable<T>
    • IEnumerable<T> vs. IQueryable<T>
  • 10.6 Query composition strategies
    • Progressive query construction
    • Using the into keyword
    • Wrapping queries
  • 10.7 AI-assisted development
      1. Verifying deferred execution and materialization
      1. LINQ syntax conversion
      1. Checking performance pitfalls
  • Summary
  • Glossary

This chapter is not available in the free preview. Purchase the book to read the complete edition now.

Buy this book