C# (.NET) and Databases: A Practical Guide
C# (.NET) and Databases: A Practical Guide
Summary:
The book "C# (.NET) and Databases: A Practical Guide" is a comprehensive resource for developers who want to master working with relational and NoSQL databases in the .NET ecosystem. The material is structured from simple to complex: from the basics of connecting to a DBMS to in-depth topics such as performance optimization, caching, and working with distributed transactions.
What the book covers
- ADO.NET Basics — manual management of connections, commands, and DataReader.
- Entity Framework Core — Code First, Fluent API, migrations, lazy loading, and working with LINQ.
- Dapper — a micro-ORM for high-performance scenarios.
- SQL Server, PostgreSQL, MySQL, SQLite — configuration and optimization specifics for each DBMS.
- Transactions and Concurrency — ACID, isolation, optimistic/pessimistic locking.
- Asynchronous Work — async/await with databases, connection pooling.
- Stored Procedures and Functions — integration with C# code.
- NoSQL — MongoDB, Redis (caching), Cosmos DB.
- Testing — unit tests with in-memory databases, integration tests.
- Real Projects — CRM system, online store, analytics service.
Who this book is for
- Beginner C# developers who want to learn how to work with data.
- Backend developers transitioning from other languages to .NET.
- Experienced programmers looking to deepen their knowledge of Entity Framework Core and Dapper.
- Students and instructors of .NET courses.
What you will learn
- How to properly design a database schema for a .NET application.
- How to choose between ADO.NET, EF Core, and Dapper for a specific task.
- How to write fast and secure SQL queries from C#.
- How to avoid the N+1 problem, memory leaks, and race conditions.
- How to integrate Redis for caching and MongoDB for flexible schemas.
- How to cover code with database tests and set up CI/CD.
All code examples are available in the GitHub repository and come with step-by-step instructions. The book is suitable for .NET 6, 7, 8, and newer versions. Regardless of your current level, after reading it you will be able to confidently develop reliable and high-performance data-driven applications.
Recommended for study on PythonLib — your portal for modern programming.