Video description
In Video Editions the narrator reads the book while the content, figures, code listings, diagrams, and text appear on the screen. Like an audiobook that you can also watch as a video.
Worth reading multiple times.
Prabhuti Prakash, Synechron Technologies
Build on your existing programming skills and upskill to professional-level C# programming.
In Code Like A Pro in C# you will learn:
- Unit testing and test-driven development
- Refactor a legacy .NET codebase
- Principles of clean code
- Essential backend architecture skills
- Query and manipulate databases with LINQ and Entity Framework Core
Critical business applications worldwide are written in the versatile C# language and the powerful .NET platform, running on desktops, cloud systems, and Windows or Linux servers. Code Like a Pro in C# makes it easy to turn your existing abilities in C# or another OO language (such as Java) into practical C# mastery. There’s no “Hello World” or Computer Science 101 basics—you’ll learn by refactoring an out-of-date legacy codebase, using new techniques, tools, and best practices to bring it up to modern C# standards.
about the technology
You know the basics, now get ready for the next step! Pro-quality C# code is efficient, clean, and fast. Whether you’re building user-facing business applications or writing data-intensive backend services, the experience-based, practical techniques in this book will take your C# skills to a new level.
about the book
Code Like a Pro in C# teaches you to how write clean C# code that’s suitable for enterprise applications. In this book, you’ll refactor a legacy codebase by applying modern C# techniques. You’ll explore tools like Entity Framework Core, design techniques like dependency injection, and key practices like testing and clean coding. It’s a perfect path to upgrade your existing C# skills or shift from another OO language into C# and the .NET ecosystem.
about the audience
For developers experienced with object-oriented programming. No C# experience required.
about the author
Jort Rodenburg is a software engineer who has taught numerous courses on getting up to speed with C# and .NET.
Packed with guidance and insights to get you there quickly. Highly recommended!
Edin Kapic, isolutions
This book really helped me to move to the next level.
Daniel Vásquez Estupiñan, Tokiota
This is the book you are looking for when you want to know how to code in the most idiomatic way possible with C#.
Gustavo Filipe Ramos Gomes, Troido
Teaches excellent techniques and best practices for modern C# development.
Foster Haines, J2 Interactive
NARRATED BY MARK THOMAS
Table of Contents
Part 1. Using C# and .NET
Chapter 1. Introducing C# and .NET
Chapter 1. Reason 2: C# is maintainable
Chapter 1. Why not work in C#?
Chapter 1. Switching to C#
Chapter 1. What you will learn in this book
Chapter 2. .NET and how it compiles
Chapter 2. How CLI-compliant languages are compiled
Chapter 2. Step 2: Common Intermediate Language (assembly level), Part 1
Chapter 2. Step 2: Common Intermediate Language (assembly level), Part 2
Chapter 2. Step 3: Native code (processor level)
Part 2. The existing codebase
Chapter 3. How bad is this code?
Chapter 3. Coming to terms with the existing codebase
Chapter 3. The existing codebase: Web service configuration files
Chapter 3. Considering models and views in the existing codebase, Part 1
Chapter 3. Considering models and views in the existing codebase, Part 2
Chapter 4. Manage your unmanaged resources!
Chapter 4. Collecting flight information with collections
Chapter 4. Querying a database with SqlCommand
Chapter 4. The FlightController: Assessing GET /flight/{flightNumber}
Chapter 4. The FlightController: DELETE /flight/{flightNumber}
Part 3. The database access layer
Chapter 5. Setting up a project and database with Entity Framework Core
Chapter 5. Setting up and configuring a web service
Chapter 5. Implementing the Startup class
Chapter 5. Implementing the database access layer
Chapter 5. Configuration methods and environment variables
Part 4. The repository layer
Chapter 6. Test-driven development and dependency injection
Chapter 6. The CreateCustomer method
Chapter 6. Validating against invalid characters
Chapter 6. Object initializers and autogenerated code
Chapter 6. Locks, mutexes, and semaphores
Chapter 6. Controlling dependencies with dependency injection, Part 1
Chapter 6. Controlling dependencies with dependency injection, Part 2
Chapter 7. Comparing objects
Chapter 7. Custom exceptions, LINQ, and extension methods
Chapter 7. Congruence: From the Middle Ages to C#
Chapter 7. Creating a “comparer” class using EqualityComparer
Chapter 7. Testing equality by overriding the Equals method
Chapter 7. Overloading the equality operator
Chapter 8. Stubbing, generics, and coupling
Chapter 8. Input validation, separation of concerns, and coupling
Chapter 8. Using object initializers
Chapter 8. Programming with generics
Chapter 8. Conditionals, Func, switches, and switch expressions
Chapter 8. Querying for pending changes in Entity Framework Core
Chapter 9. Extension methods, streams, and abstract classes
Chapter 9. Validating the AirportID input parameter
Chapter 9. Querying the database for an Airport object, Part 1
Chapter 9. Querying the database for an Airport object, Part 2
Chapter 9. Implementing the Flight repository
Chapter 9. The IsPositive extension method and “magic numbers”
Chapter 9. Getting a flight out of the database
Part 5. The service layer
Chapter 10. Reflection and mocks
Chapter 10. Implementing the CustomerService
Chapter 10. Implementing the BookingService
Chapter 10. Unit testing across architectural layers
Chapter 10. Mocking a class with the Moq library, Part 1
Chapter 10. Mocking a class with the Moq library, Part 2
Chapter 10. Calling a repository from a service
Chapter 11. Runtime type checking revisited and error handling
Chapter 11. Cleaning up the BookingServiceTests class
Chapter 11. Calling the Flight repository from a service class, Part 1
Chapter 11. Calling the Flight repository from a service class, Part 2
Chapter 12. Using IAsyncEnumerable and yield return
Chapter 12.Combining two data streams into a view
Chapter 12. Using the yield return keywords with try-catch code blocks
Chapter 12. Implementing GetFlightByFlightNumber
Part 6. The controller layer
Chapter 13. Middleware, HTTP routing, and HTTP responses
Chapter 13. Returning HTTP responses with the IActionResult interface (GetFlights)
Chapter 13. Injecting dependencies into a controller using middleware
Chapter 13. Implementing the GET /Flight/{FlightNumber} endpoint
Chapter 13. Routing HTTP requests to controllers and methods
Chapter 14. JSON serialization/ deserialization and custom model binding
Chapter 14. Using the [FromBody] attribute to deserialize incoming HTTP data
Chapter 14. Implementing the CreateBooking endpoint method logic
Chapter 14. Acceptance testing and Swagger middleware
Chapter 14. Generating an OpenAPI specification at runtime
Appendix B. Clean code checklist